Previous | 199869 Revisions | Next |
r18113 Monday 24th September, 2012 at 14:09:14 UTC by Miodrag Milanović |
---|
Introducing TIMER_CALLBACK_MEMBER and modernization part 1 (no whatsnew) |
[src/emu] | schedule.h |
[src/emu/cpu/psx] | dma.c dma.h rcnt.c rcnt.h sio.c sio.h |
[src/mame/drivers] | 40love.c artmagic.c asterix.c asuka.c atarisy2.c atetris.c bigevglf.c bombjack.c buggychl.c capbowl.c cave.c ccastles.c champbas.c cidelsa.c cloud9.c coolpool.c crgolf.c cvs.c dec8.c equites.c esripsys.c exidy440.c exterm.c fgoal.c firetrk.c flstory.c fromance.c fuukifg2.c fuukifg3.c gaelco3d.c galaga.c galastrm.c gaplus.c gcpinbal.c gijoe.c gottlieb.c grchamp.c gridlee.c groundfx.c gunbustr.c hyprduel.c itech32.c itech8.c jedi.c konamigx.c ladyfrog.c lkage.c m10.c m72.c magmax.c mappy.c metro.c midvunit.c midzeus.c model3.c moo.c msisaac.c mustache.c mw8080bw.c namcofl.c namconb1.c namcos22.c neogeo.c nycaptor.c orbit.c othunder.c parodius.c policetr.c psikyo.c qdrmfgp.c rltennis.c rollerg.c rpunch.c runaway.c segas32.c seta.c simpsons.c skullxbo.c slapshot.c snk.c spacefb.c sprint4.c sslam.c superqix.c suprridr.c taito_b.c taito_f2.c taito_f3.c taito_z.c tankbust.c tehkanwc.c tetrisp2.c thunderx.c tmnt.c toaplan2.c topspeed.c toypop.c trucocl.c tubep.c turbo.c ultratnk.c undrfire.c vendetta.c vicdual.c videopin.c wgp.c wolfpack.c xexex.c |
[src/mame/includes] | 40love.h amiga.h arkanoid.h artmagic.h asterix.h astrocde.h asuka.h atarisy2.h atetris.h balsente.h bigevglf.h blstroid.h bombjack.h bublbobl.h buggychl.h capbowl.h cave.h ccastles.h cchasm.h champbas.h changela.h cidelsa.h cloud9.h coolpool.h crgolf.h cvs.h dc.h dcheese.h dday.h dec8.h dkong.h equites.h esripsys.h exidy.h exidy440.h exterm.h fgoal.h firetrk.h flstory.h fromance.h fuukifg2.h fuukifg3.h gaelco3d.h galaga.h galastrm.h galaxold.h gameplan.h gaplus.h gcpinbal.h gijoe.h gottlieb.h grchamp.h gridlee.h groundfx.h gunbustr.h harddriv.h hyhoo.h hyprduel.h irobot.h itech32.h itech8.h jedi.h konamigx.h ladyfrog.h leland.h lethalj.h lkage.h lockon.h lsasquad.h m10.h m72.h m92.h magmax.h mappy.h mcr.h mcr68.h metro.h mhavoc.h micro3d.h midtunit.h midvunit.h midyunit.h midzeus.h model3.h moo.h msisaac.h mustache.h mw8080bw.h mystston.h n64.h n8080.h namcofl.h namconb1.h namcos2.h namcos22.h nbmj8688.h nbmj8891.h nbmj8900.h nbmj8991.h nbmj9195.h neogeo.h niyanpai.h nycaptor.h opwolf.h orbit.h othunder.h parodius.h pastelg.h pitnrun.h policetr.h psikyo.h qdrmfgp.h qix.h rainbow.h rltennis.h rollerg.h rpunch.h runaway.h segag80r.h segas32.h seta.h simpsons.h skullxbo.h slapshot.h snes.h snk.h spacefb.h sprint4.h sprint8.h sslam.h starfire.h starwars.h stfight.h superqix.h suprridr.h taito_b.h taito_f2.h taito_f3.h taito_z.h taitosj.h tank8.h tankbust.h tehkanwc.h tetrisp2.h thunderx.h tmnt.h tnzs.h toaplan2.h topspeed.h toypop.h triplhnt.h trucocl.h tubep.h turbo.h twin16.h tx1.h ultratnk.h undrfire.h vectrex.h vendetta.h vertigo.h vicdual.h victory.h videopin.h volfied.h wgp.h williams.h wolfpack.h xexex.h |
[src/mame/machine] | amiga.c arkanoid.c balsente.c bublbobl.c dc.c harddriv.c irobot.c leland.c lsasquad.c mcr.c mcr68.c mhavoc.c micro3d.c mw8080bw.c n64.c namcos2.c opwolf.c pitnrun.c qix.c rainbow.c snes.c starwars.c stfight.c taitosj.c tnzs.c vectrex.c vertigo.c volfied.c williams.c |
[src/mame/video] | astrocde.c atarisy2.c blstroid.c cchasm.c changela.c dc.c dcheese.c dday.c dkong.c esripsys.c exidy.c exidy440.c fromance.c galaxold.c gameplan.c hyhoo.c itech32.c itech8.c leland.c lethalj.c lockon.c m92.c midtunit.c midvunit.c midyunit.c mystston.c n8080.c nbmj8688.c nbmj8891.c nbmj8900.c nbmj8991.c nbmj9195.c neogeo.c niyanpai.c pastelg.c rpunch.c segag80r.c segas32.c sprint8.c starfire.c tank8.c triplhnt.c tubep.c twin16.c tx1.c vectrex.c victory.c |
r18112 | r18113 | |
---|---|---|
95 | 95 | #define MCU_CLOCK (XTAL_12MHz/4) |
96 | 96 | |
97 | 97 | |
98 | ||
98 | TIMER_CALLBACK_MEMBER(lkage_state::nmi_callback) | |
99 | 99 | { |
100 | lkage_state *state = machine.driver_data<lkage_state>(); | |
101 | if (state->m_sound_nmi_enable) | |
102 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
100 | if (m_sound_nmi_enable) | |
101 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
103 | 102 | else |
104 | | |
103 | m_pending_nmi = 1; | |
105 | 104 | } |
106 | 105 | |
107 | 106 | WRITE8_MEMBER(lkage_state::lkage_sound_command_w) |
108 | 107 | { |
109 | 108 | soundlatch_byte_w(space, offset, data); |
110 | machine().scheduler().synchronize(FUNC(nmi_callback), data); | |
109 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(lkage_state::nmi_callback),this), data); | |
111 | 110 | } |
112 | 111 | |
113 | 112 | WRITE8_MEMBER(lkage_state::lkage_sh_nmi_disable_w) |
r18112 | r18113 | |
---|---|---|
343 | 343 | |
344 | 344 | /*********************************************************************/ |
345 | 345 | |
346 | ||
346 | TIMER_CALLBACK_MEMBER(snk_state::sgladiat_sndirq_update_callback) | |
347 | 347 | { |
348 | snk_state *state = machine.driver_data<snk_state>(); | |
349 | 348 | |
350 | 349 | switch(param) |
351 | 350 | { |
352 | 351 | case CMDIRQ_BUSY_ASSERT: |
353 | | |
352 | m_sound_status |= 8|4; | |
354 | 353 | break; |
355 | 354 | |
356 | 355 | case BUSY_CLEAR: |
357 | | |
356 | m_sound_status &= ~4; | |
358 | 357 | break; |
359 | 358 | |
360 | 359 | case CMDIRQ_CLEAR: |
361 | | |
360 | m_sound_status &= ~8; | |
362 | 361 | break; |
363 | 362 | } |
364 | 363 | |
365 | machine.device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, ( | |
364 | machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, (m_sound_status & 0x8) ? ASSERT_LINE : CLEAR_LINE); | |
366 | 365 | } |
367 | 366 | |
368 | 367 | |
369 | 368 | WRITE8_MEMBER(snk_state::sgladiat_soundlatch_w) |
370 | 369 | { |
371 | 370 | soundlatch_byte_w(space, offset, data); |
372 | machine().scheduler().synchronize(FUNC(sgladiat_sndirq_update_callback), CMDIRQ_BUSY_ASSERT); | |
371 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sgladiat_sndirq_update_callback),this), CMDIRQ_BUSY_ASSERT); | |
373 | 372 | } |
374 | 373 | |
375 | 374 | READ8_MEMBER(snk_state::sgladiat_soundlatch_r) |
376 | 375 | { |
377 | machine().scheduler().synchronize(FUNC(sgladiat_sndirq_update_callback), BUSY_CLEAR); | |
376 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sgladiat_sndirq_update_callback),this), BUSY_CLEAR); | |
378 | 377 | return soundlatch_byte_r(space,0); |
379 | 378 | } |
380 | 379 | |
381 | 380 | READ8_MEMBER(snk_state::sgladiat_sound_nmi_ack_r) |
382 | 381 | { |
383 | machine().scheduler().synchronize(FUNC(sgladiat_sndirq_update_callback), CMDIRQ_CLEAR); | |
382 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sgladiat_sndirq_update_callback),this), CMDIRQ_CLEAR); | |
384 | 383 | return 0xff; |
385 | 384 | } |
386 | 385 | |
r18112 | r18113 | |
414 | 413 | |
415 | 414 | *********************************************************************/ |
416 | 415 | |
417 | ||
416 | TIMER_CALLBACK_MEMBER(snk_state::sndirq_update_callback) | |
418 | 417 | { |
419 | snk_state *state = machine.driver_data<snk_state>(); | |
420 | 418 | |
421 | 419 | switch(param) |
422 | 420 | { |
423 | 421 | case YM1IRQ_ASSERT: |
424 | | |
422 | m_sound_status |= 1; | |
425 | 423 | break; |
426 | 424 | |
427 | 425 | case YM1IRQ_CLEAR: |
428 | | |
426 | m_sound_status &= ~1; | |
429 | 427 | break; |
430 | 428 | |
431 | 429 | case YM2IRQ_ASSERT: |
432 | | |
430 | m_sound_status |= 2; | |
433 | 431 | break; |
434 | 432 | |
435 | 433 | case YM2IRQ_CLEAR: |
436 | | |
434 | m_sound_status &= ~2; | |
437 | 435 | break; |
438 | 436 | |
439 | 437 | case CMDIRQ_BUSY_ASSERT: |
440 | | |
438 | m_sound_status |= 8|4; | |
441 | 439 | break; |
442 | 440 | |
443 | 441 | case BUSY_CLEAR: |
444 | | |
442 | m_sound_status &= ~4; | |
445 | 443 | break; |
446 | 444 | |
447 | 445 | case CMDIRQ_CLEAR: |
448 | | |
446 | m_sound_status &= ~8; | |
449 | 447 | break; |
450 | 448 | } |
451 | 449 | |
452 | machine.device("audiocpu")->execute().set_input_line(0, ( | |
450 | machine().device("audiocpu")->execute().set_input_line(0, (m_sound_status & 0xb) ? ASSERT_LINE : CLEAR_LINE); | |
453 | 451 | } |
454 | 452 | |
455 | 453 | |
456 | 454 | |
457 | 455 | static WRITE_LINE_DEVICE_HANDLER( ymirq_callback_1 ) |
458 | 456 | { |
457 | snk_state *drvstate = device->machine().driver_data<snk_state>(); | |
459 | 458 | if (state) |
460 | device->machine().scheduler().synchronize(FUNC(sndirq_update_callback), YM1IRQ_ASSERT); | |
459 | device->machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),drvstate), YM1IRQ_ASSERT); | |
461 | 460 | } |
462 | 461 | |
463 | 462 | static WRITE_LINE_DEVICE_HANDLER( ymirq_callback_2 ) |
464 | 463 | { |
464 | snk_state *drvstate = device->machine().driver_data<snk_state>(); | |
465 | 465 | if (state) |
466 | device->machine().scheduler().synchronize(FUNC(sndirq_update_callback), YM2IRQ_ASSERT); | |
466 | device->machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),drvstate), YM2IRQ_ASSERT); | |
467 | 467 | } |
468 | 468 | |
469 | 469 | |
r18112 | r18113 | |
492 | 492 | WRITE8_MEMBER(snk_state::snk_soundlatch_w) |
493 | 493 | { |
494 | 494 | soundlatch_byte_w(space, offset, data); |
495 | machine().scheduler().synchronize(FUNC(sndirq_update_callback), CMDIRQ_BUSY_ASSERT); | |
495 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), CMDIRQ_BUSY_ASSERT); | |
496 | 496 | } |
497 | 497 | |
498 | 498 | CUSTOM_INPUT_MEMBER(snk_state::snk_sound_busy) |
r18112 | r18113 | |
512 | 512 | WRITE8_MEMBER(snk_state::snk_sound_status_w) |
513 | 513 | { |
514 | 514 | if (~data & 0x10) // ack YM1 irq |
515 | machine().scheduler().synchronize(FUNC(sndirq_update_callback), YM1IRQ_CLEAR); | |
515 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), YM1IRQ_CLEAR); | |
516 | 516 | |
517 | 517 | if (~data & 0x20) // ack YM2 irq |
518 | machine().scheduler().synchronize(FUNC(sndirq_update_callback), YM2IRQ_CLEAR); | |
518 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), YM2IRQ_CLEAR); | |
519 | 519 | |
520 | 520 | if (~data & 0x40) // clear busy flag |
521 | machine().scheduler().synchronize(FUNC(sndirq_update_callback), BUSY_CLEAR); | |
521 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), BUSY_CLEAR); | |
522 | 522 | |
523 | 523 | if (~data & 0x80) // ack command from main cpu |
524 | machine().scheduler().synchronize(FUNC(sndirq_update_callback), CMDIRQ_CLEAR); | |
524 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), CMDIRQ_CLEAR); | |
525 | 525 | } |
526 | 526 | |
527 | 527 | |
528 | 528 | |
529 | 529 | READ8_MEMBER(snk_state::tnk3_cmdirq_ack_r) |
530 | 530 | { |
531 | machine().scheduler().synchronize(FUNC(sndirq_update_callback), CMDIRQ_CLEAR); | |
531 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), CMDIRQ_CLEAR); | |
532 | 532 | return 0xff; |
533 | 533 | } |
534 | 534 | |
535 | 535 | READ8_MEMBER(snk_state::tnk3_ymirq_ack_r) |
536 | 536 | { |
537 | machine().scheduler().synchronize(FUNC(sndirq_update_callback), YM1IRQ_CLEAR); | |
537 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), YM1IRQ_CLEAR); | |
538 | 538 | return 0xff; |
539 | 539 | } |
540 | 540 | |
r18112 | r18113 | |
542 | 542 | { |
543 | 543 | // it's uncertain whether the latch should be cleared here or when it's read |
544 | 544 | soundlatch_clear_byte_w(space, 0, 0); |
545 | machine().scheduler().synchronize(FUNC(sndirq_update_callback), BUSY_CLEAR); | |
545 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), BUSY_CLEAR); | |
546 | 546 | return 0xff; |
547 | 547 | } |
548 | 548 |
r18112 | r18113 | |
---|---|---|
231 | 231 | #include "machine/buggychl.h" |
232 | 232 | #include "includes/40love.h" |
233 | 233 | |
234 | ||
234 | TIMER_CALLBACK_MEMBER(fortyl_state::nmi_callback) | |
235 | 235 | { |
236 | fortyl_state *state = machine.driver_data<fortyl_state>(); | |
237 | if (state->m_sound_nmi_enable) | |
238 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
236 | if (m_sound_nmi_enable) | |
237 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
239 | 238 | else |
240 | | |
239 | m_pending_nmi = 1; | |
241 | 240 | } |
242 | 241 | |
243 | 242 | WRITE8_MEMBER(fortyl_state::sound_command_w) |
244 | 243 | { |
245 | 244 | soundlatch_byte_w(space, 0, data); |
246 | machine().scheduler().synchronize(FUNC(nmi_callback), data); | |
245 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(fortyl_state::nmi_callback),this), data); | |
247 | 246 | } |
248 | 247 | |
249 | 248 | WRITE8_MEMBER(fortyl_state::nmi_disable_w) |
r18112 | r18113 | |
---|---|---|
857 | 857 | }; |
858 | 858 | |
859 | 859 | |
860 | ||
860 | TIMER_CALLBACK_MEMBER(galaga_state::cpu3_interrupt_callback) | |
861 | 861 | { |
862 | galaga_state *state = machine.driver_data<galaga_state>(); | |
863 | 862 | int scanline = param; |
864 | 863 | |
865 | if(state->m_sub2_nmi_mask) | |
866 | nmi_line_pulse(machine.device("sub2")); | |
864 | if(m_sub2_nmi_mask) | |
865 | nmi_line_pulse(machine().device("sub2")->execute()); | |
867 | 866 | |
868 | 867 | scanline = scanline + 128; |
869 | 868 | if (scanline >= 272) |
870 | 869 | scanline = 64; |
871 | 870 | |
872 | 871 | /* the vertical synch chain is clocked by H256 -- this is probably not important, but oh well */ |
873 | | |
872 | m_cpu3_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
874 | 873 | } |
875 | 874 | |
876 | 875 | |
r18112 | r18113 | |
878 | 877 | { |
879 | 878 | |
880 | 879 | /* create the interrupt timer */ |
881 | m_cpu3_interrupt_timer = machine().scheduler().timer_alloc(FUNC(cpu3_interrupt_callback)); | |
880 | m_cpu3_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(galaga_state::cpu3_interrupt_callback),this)); | |
882 | 881 | m_custom_mod = 0; |
883 | 882 | state_save_register_global(machine(), m_custom_mod); |
884 | 883 | save_item(NAME(m_main_irq_mask)); |
r18112 | r18113 | |
---|---|---|
284 | 284 | } |
285 | 285 | |
286 | 286 | |
287 | ||
287 | TIMER_CALLBACK_MEMBER(atarisy2_state::delayed_int_enable_w) | |
288 | 288 | { |
289 | atarisy2_state *state = machine.driver_data<atarisy2_state>(); | |
290 | state->m_interrupt_enable = param; | |
289 | m_interrupt_enable = param; | |
291 | 290 | } |
292 | 291 | |
293 | 292 | |
294 | 293 | WRITE16_MEMBER(atarisy2_state::int_enable_w) |
295 | 294 | { |
296 | 295 | if (offset == 0 && ACCESSING_BITS_0_7) |
297 | machine().scheduler().synchronize(FUNC(delayed_int_enable_w), data); | |
296 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(atarisy2_state::delayed_int_enable_w),this), data); | |
298 | 297 | } |
299 | 298 | |
300 | 299 |
r18112 | r18113 | |
---|---|---|
61 | 61 | |
62 | 62 | static emu_timer *timer[2]; |
63 | 63 | |
64 | static TIMER_CALLBACK( invasn_gun_callback ); | |
65 | 64 | |
66 | 65 | |
67 | 66 | |
67 | ||
68 | 68 | /************************************* |
69 | 69 | * |
70 | 70 | * Machine init |
r18112 | r18113 | |
76 | 76 | timer[0] = machine().scheduler().timer_alloc(FUNC_NULL); |
77 | 77 | timer[1] = machine().scheduler().timer_alloc(FUNC_NULL); |
78 | 78 | |
79 | gun_timer[0] = machine().scheduler().timer_alloc(FUNC(invasn_gun_callback)); | |
80 | gun_timer[1] = machine().scheduler().timer_alloc(FUNC(invasn_gun_callback)); | |
79 | gun_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(midzeus_state::invasn_gun_callback),this)); | |
80 | gun_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(midzeus_state::invasn_gun_callback),this)); | |
81 | 81 | |
82 | 82 | state_save_register_global(machine(), gun_control); |
83 | 83 | state_save_register_global(machine(), gun_irq_state); |
r18112 | r18113 | |
106 | 106 | * |
107 | 107 | *************************************/ |
108 | 108 | |
109 | ||
109 | TIMER_CALLBACK_MEMBER(midzeus_state::display_irq_off) | |
110 | 110 | { |
111 | machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE); | |
111 | machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE); | |
112 | 112 | } |
113 | 113 | |
114 | 114 | INTERRUPT_GEN_MEMBER(midzeus_state::display_irq) |
115 | 115 | { |
116 | 116 | device.execute().set_input_line(0, ASSERT_LINE); |
117 | machine().scheduler().timer_set(attotime::from_hz(30000000), FUNC(display_irq_off)); | |
117 | machine().scheduler().timer_set(attotime::from_hz(30000000), timer_expired_delegate(FUNC(midzeus_state::display_irq_off),this)); | |
118 | 118 | } |
119 | 119 | |
120 | 120 | |
r18112 | r18113 | |
489 | 489 | } |
490 | 490 | |
491 | 491 | |
492 | ||
492 | TIMER_CALLBACK_MEMBER(midzeus_state::invasn_gun_callback) | |
493 | 493 | { |
494 | 494 | int player = param; |
495 | int beamy = machine.primary_screen->vpos(); | |
495 | int beamy = machine().primary_screen->vpos(); | |
496 | 496 | |
497 | 497 | /* set the appropriate IRQ in the internal gun control and update */ |
498 | 498 | gun_irq_state |= 0x01 << player; |
499 | update_gun_irq(machine); | |
499 | update_gun_irq(machine()); | |
500 | 500 | |
501 | 501 | /* generate another interrupt on the next scanline while we are within the BEAM_DY */ |
502 | 502 | beamy++; |
503 | if (beamy <= machine.primary_screen->visible_area().max_y && beamy <= gun_y[player] + BEAM_DY) | |
504 | gun_timer[player]->adjust(machine.primary_screen->time_until_pos(beamy, MAX(0, gun_x[player] - BEAM_DX)), player); | |
503 | if (beamy <= machine().primary_screen->visible_area().max_y && beamy <= gun_y[player] + BEAM_DY) | |
504 | gun_timer[player]->adjust(machine().primary_screen->time_until_pos(beamy, MAX(0, gun_x[player] - BEAM_DX)), player); | |
505 | 505 | } |
506 | 506 | |
507 | 507 |
r18112 | r18113 | |
---|---|---|
171 | 171 | INTERRUPTS |
172 | 172 | ***********************************************************/ |
173 | 173 | |
174 | ||
174 | TIMER_CALLBACK_MEMBER(slapshot_state::slapshot_interrupt6) | |
175 | 175 | { |
176 | slapshot_state *state = machine.driver_data<slapshot_state>(); | |
177 | state->m_maincpu->set_input_line(6, HOLD_LINE); | |
176 | m_maincpu->set_input_line(6, HOLD_LINE); | |
178 | 177 | } |
179 | 178 | |
180 | 179 | |
181 | 180 | INTERRUPT_GEN_MEMBER(slapshot_state::slapshot_interrupt) |
182 | 181 | { |
183 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000 - 500), FUNC(slapshot_interrupt6)); | |
182 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000 - 500), timer_expired_delegate(FUNC(slapshot_state::slapshot_interrupt6),this)); | |
184 | 183 | device.execute().set_input_line(5, HOLD_LINE); |
185 | 184 | } |
186 | 185 |
r18112 | r18113 | |
---|---|---|
444 | 444 | /* 68000 A */ |
445 | 445 | |
446 | 446 | #ifdef UNUSED_FUNCTION |
447 | ||
447 | TIMER_CALLBACK_MEMBER(wgp_state::wgp_interrupt4) | |
448 | 448 | { |
449 | wgp_state *state = machine.driver_data<wgp_state>(); | |
450 | state->m_maincpu->set_input_line(4, HOLD_LINE); | |
449 | m_maincpu->set_input_line(4, HOLD_LINE); | |
451 | 450 | } |
452 | 451 | #endif |
453 | 452 | |
454 | ||
453 | TIMER_CALLBACK_MEMBER(wgp_state::wgp_interrupt6) | |
455 | 454 | { |
456 | wgp_state *state = machine.driver_data<wgp_state>(); | |
457 | state->m_maincpu->set_input_line(6, HOLD_LINE); | |
455 | m_maincpu->set_input_line(6, HOLD_LINE); | |
458 | 456 | } |
459 | 457 | |
460 | 458 | /* 68000 B */ |
461 | 459 | |
462 | ||
460 | TIMER_CALLBACK_MEMBER(wgp_state::wgp_cpub_interrupt6) | |
463 | 461 | { |
464 | wgp_state *state = machine.driver_data<wgp_state>(); | |
465 | state->m_subcpu->set_input_line(6, HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */ | |
462 | m_subcpu->set_input_line(6, HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */ | |
466 | 463 | } |
467 | 464 | |
468 | 465 | |
r18112 | r18113 | |
474 | 471 | |
475 | 472 | INTERRUPT_GEN_MEMBER(wgp_state::wgp_cpub_interrupt) |
476 | 473 | { |
477 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000-500), FUNC(wgp_cpub_interrupt6)); | |
474 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000-500), timer_expired_delegate(FUNC(wgp_state::wgp_cpub_interrupt6),this)); | |
478 | 475 | device.execute().set_input_line(4, HOLD_LINE); |
479 | 476 | } |
480 | 477 | |
r18112 | r18113 | |
597 | 594 | hardware has got the next a/d conversion ready. We set a token |
598 | 595 | delay of 10000 cycles although our inputs are always ready. */ |
599 | 596 | |
600 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), FUNC(wgp_interrupt6)); | |
597 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), timer_expired_delegate(FUNC(wgp_state::wgp_interrupt6),this)); | |
601 | 598 | } |
602 | 599 | |
603 | 600 |
r18112 | r18113 | |
---|---|---|
354 | 354 | * |
355 | 355 | *************************************/ |
356 | 356 | |
357 | ||
357 | TIMER_CALLBACK_MEMBER(exidy440_state::delayed_sound_command_w) | |
358 | 358 | { |
359 | exidy440_state *state = machine.driver_data<exidy440_state>(); | |
360 | exidy440_sound_command(state->m_custom, param); | |
359 | exidy440_sound_command(m_custom, param); | |
361 | 360 | } |
362 | 361 | |
363 | 362 | |
364 | 363 | WRITE8_MEMBER(exidy440_state::sound_command_w) |
365 | 364 | { |
366 | machine().scheduler().synchronize(FUNC(delayed_sound_command_w), data); | |
365 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(exidy440_state::delayed_sound_command_w),this), data); | |
367 | 366 | } |
368 | 367 | |
369 | 368 |
r18112 | r18113 | |
---|---|---|
196 | 196 | membank("bank1")->set_entry((data - 1) & 3); |
197 | 197 | } |
198 | 198 | |
199 | ||
199 | TIMER_CALLBACK_MEMBER(taitob_state::rsaga2_interrupt2) | |
200 | 200 | { |
201 | taitob_state *state = machine.driver_data<taitob_state>(); | |
202 | state->m_maincpu->set_input_line(2, HOLD_LINE); | |
201 | m_maincpu->set_input_line(2, HOLD_LINE); | |
203 | 202 | } |
204 | 203 | |
205 | 204 | INTERRUPT_GEN_MEMBER(taitob_state::rastansaga2_interrupt) |
206 | 205 | { |
207 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), FUNC(rsaga2_interrupt2)); | |
206 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), timer_expired_delegate(FUNC(taitob_state::rsaga2_interrupt2),this)); | |
208 | 207 | device.execute().set_input_line(4, HOLD_LINE); |
209 | 208 | } |
210 | 209 | |
211 | 210 | |
212 | ||
211 | TIMER_CALLBACK_MEMBER(taitob_state::crimec_interrupt3) | |
213 | 212 | { |
214 | taitob_state *state = machine.driver_data<taitob_state>(); | |
215 | state->m_maincpu->set_input_line(3, HOLD_LINE); | |
213 | m_maincpu->set_input_line(3, HOLD_LINE); | |
216 | 214 | } |
217 | 215 | |
218 | 216 | INTERRUPT_GEN_MEMBER(taitob_state::crimec_interrupt) |
219 | 217 | { |
220 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), FUNC(crimec_interrupt3)); | |
218 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), timer_expired_delegate(FUNC(taitob_state::crimec_interrupt3),this)); | |
221 | 219 | device.execute().set_input_line(5, HOLD_LINE); |
222 | 220 | } |
223 | 221 | |
224 | 222 | |
225 | ||
223 | TIMER_CALLBACK_MEMBER(taitob_state::hitice_interrupt6) | |
226 | 224 | { |
227 | taitob_state *state = machine.driver_data<taitob_state>(); | |
228 | state->m_maincpu->set_input_line(6, HOLD_LINE); | |
225 | m_maincpu->set_input_line(6, HOLD_LINE); | |
229 | 226 | } |
230 | 227 | |
231 | 228 | INTERRUPT_GEN_MEMBER(taitob_state::hitice_interrupt) |
232 | 229 | { |
233 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), FUNC(hitice_interrupt6)); | |
230 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), timer_expired_delegate(FUNC(taitob_state::hitice_interrupt6),this)); | |
234 | 231 | device.execute().set_input_line(4, HOLD_LINE); |
235 | 232 | } |
236 | 233 | |
237 | 234 | |
238 | ||
235 | TIMER_CALLBACK_MEMBER(taitob_state::rambo3_interrupt1) | |
239 | 236 | { |
240 | taitob_state *state = machine.driver_data<taitob_state>(); | |
241 | state->m_maincpu->set_input_line(1, HOLD_LINE); | |
237 | m_maincpu->set_input_line(1, HOLD_LINE); | |
242 | 238 | } |
243 | 239 | |
244 | 240 | INTERRUPT_GEN_MEMBER(taitob_state::rambo3_interrupt) |
245 | 241 | { |
246 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), FUNC(rambo3_interrupt1)); | |
242 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), timer_expired_delegate(FUNC(taitob_state::rambo3_interrupt1),this)); | |
247 | 243 | device.execute().set_input_line(6, HOLD_LINE); |
248 | 244 | } |
249 | 245 | |
250 | 246 | |
251 | ||
247 | TIMER_CALLBACK_MEMBER(taitob_state::pbobble_interrupt5) | |
252 | 248 | { |
253 | taitob_state *state = machine.driver_data<taitob_state>(); | |
254 | state->m_maincpu->set_input_line(5, HOLD_LINE); | |
249 | m_maincpu->set_input_line(5, HOLD_LINE); | |
255 | 250 | } |
256 | 251 | |
257 | 252 | INTERRUPT_GEN_MEMBER(taitob_state::pbobble_interrupt) |
258 | 253 | { |
259 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), FUNC(pbobble_interrupt5)); | |
254 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), timer_expired_delegate(FUNC(taitob_state::pbobble_interrupt5),this)); | |
260 | 255 | device.execute().set_input_line(3, HOLD_LINE); |
261 | 256 | } |
262 | 257 | |
263 | ||
258 | TIMER_CALLBACK_MEMBER(taitob_state::viofight_interrupt1) | |
264 | 259 | { |
265 | taitob_state *state = machine.driver_data<taitob_state>(); | |
266 | state->m_maincpu->set_input_line(1, HOLD_LINE); | |
260 | m_maincpu->set_input_line(1, HOLD_LINE); | |
267 | 261 | } |
268 | 262 | |
269 | 263 | INTERRUPT_GEN_MEMBER(taitob_state::viofight_interrupt) |
270 | 264 | { |
271 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), FUNC(viofight_interrupt1)); | |
265 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), timer_expired_delegate(FUNC(taitob_state::viofight_interrupt1),this)); | |
272 | 266 | device.execute().set_input_line(4, HOLD_LINE); |
273 | 267 | } |
274 | 268 | |
275 | ||
269 | TIMER_CALLBACK_MEMBER(taitob_state::masterw_interrupt4) | |
276 | 270 | { |
277 | taitob_state *state = machine.driver_data<taitob_state>(); | |
278 | state->m_maincpu->set_input_line(4, HOLD_LINE); | |
271 | m_maincpu->set_input_line(4, HOLD_LINE); | |
279 | 272 | } |
280 | 273 | |
281 | 274 | INTERRUPT_GEN_MEMBER(taitob_state::masterw_interrupt) |
282 | 275 | { |
283 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), FUNC(masterw_interrupt4)); | |
276 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), timer_expired_delegate(FUNC(taitob_state::masterw_interrupt4),this)); | |
284 | 277 | device.execute().set_input_line(5, HOLD_LINE); |
285 | 278 | } |
286 | 279 | |
287 | ||
280 | TIMER_CALLBACK_MEMBER(taitob_state::silentd_interrupt4) | |
288 | 281 | { |
289 | taitob_state *state = machine.driver_data<taitob_state>(); | |
290 | state->m_maincpu->set_input_line(4, HOLD_LINE); | |
282 | m_maincpu->set_input_line(4, HOLD_LINE); | |
291 | 283 | } |
292 | 284 | |
293 | 285 | INTERRUPT_GEN_MEMBER(taitob_state::silentd_interrupt) |
294 | 286 | { |
295 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), FUNC(silentd_interrupt4)); | |
287 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), timer_expired_delegate(FUNC(taitob_state::silentd_interrupt4),this)); | |
296 | 288 | device.execute().set_input_line(6, HOLD_LINE); |
297 | 289 | } |
298 | 290 | |
299 | ||
291 | TIMER_CALLBACK_MEMBER(taitob_state::selfeena_interrupt4) | |
300 | 292 | { |
301 | taitob_state *state = machine.driver_data<taitob_state>(); | |
302 | state->m_maincpu->set_input_line(4, HOLD_LINE); | |
293 | m_maincpu->set_input_line(4, HOLD_LINE); | |
303 | 294 | } |
304 | 295 | |
305 | 296 | INTERRUPT_GEN_MEMBER(taitob_state::selfeena_interrupt) |
306 | 297 | { |
307 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), FUNC(selfeena_interrupt4)); | |
298 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(5000), timer_expired_delegate(FUNC(taitob_state::selfeena_interrupt4),this)); | |
308 | 299 | device.execute().set_input_line(6, HOLD_LINE); |
309 | 300 | } |
310 | 301 | |
311 | ||
302 | TIMER_CALLBACK_MEMBER(taitob_state::sbm_interrupt5)//4 | |
312 | 303 | { |
313 | taitob_state *state = machine.driver_data<taitob_state>(); | |
314 | state->m_maincpu->set_input_line(5, HOLD_LINE); | |
304 | m_maincpu->set_input_line(5, HOLD_LINE); | |
315 | 305 | } |
316 | 306 | |
317 | 307 | INTERRUPT_GEN_MEMBER(taitob_state::sbm_interrupt)//5 |
318 | 308 | { |
319 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(10000), FUNC(sbm_interrupt5)); | |
309 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(10000), timer_expired_delegate(FUNC(taitob_state::sbm_interrupt5),this)); | |
320 | 310 | device.execute().set_input_line(4, HOLD_LINE); |
321 | 311 | } |
322 | 312 | |
323 | ||
313 | TIMER_CALLBACK_MEMBER(taitob_state::realpunc_interrupt3)//3 | |
324 | 314 | { |
325 | taitob_state *state = machine.driver_data<taitob_state>(); | |
326 | state->m_maincpu->set_input_line(3, HOLD_LINE); | |
315 | m_maincpu->set_input_line(3, HOLD_LINE); | |
327 | 316 | } |
328 | 317 | |
329 | 318 | INTERRUPT_GEN_MEMBER(taitob_state::realpunc_interrupt)//2 |
330 | 319 | { |
331 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(10000), FUNC(realpunc_interrupt3)); | |
320 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(10000), timer_expired_delegate(FUNC(taitob_state::realpunc_interrupt3),this)); | |
332 | 321 | device.execute().set_input_line(2, HOLD_LINE); |
333 | 322 | } |
334 | 323 |
r18112 | r18113 | |
---|---|---|
255 | 255 | flt_volume_set_volume(state->m_filter2r, (71.0 * right) / 55.0); |
256 | 256 | } |
257 | 257 | |
258 | ||
258 | TIMER_CALLBACK_MEMBER(xexex_state::dmaend_callback) | |
259 | 259 | { |
260 | xexex_state *state = machine.driver_data<xexex_state>(); | |
261 | 260 | |
262 | if ( | |
261 | if (m_cur_control2 & 0x0040) | |
263 | 262 | { |
264 | 263 | // foul-proof (CPU0 could be deactivated while we wait) |
265 | if ( | |
264 | if (m_suspension_active) | |
266 | 265 | { |
267 | state->m_suspension_active = 0; | |
268 | machine.scheduler().trigger(state->m_resume_trigger); | |
266 | m_suspension_active = 0; | |
267 | machine().scheduler().trigger(m_resume_trigger); | |
269 | 268 | } |
270 | 269 | |
271 | 270 | // IRQ 5 is the "object DMA end interrupt" and shouldn't be triggered |
272 | 271 | // if object data isn't ready for DMA within the frame. |
273 | | |
272 | m_maincpu->set_input_line(5, HOLD_LINE); | |
274 | 273 | } |
275 | 274 | } |
276 | 275 | |
r18112 | r18113 | |
486 | 485 | save_item(NAME(m_cur_sound_region)); |
487 | 486 | machine().save().register_postload(save_prepost_delegate(FUNC(xexex_postload), &machine())); |
488 | 487 | |
489 | m_dmadelay_timer = machine().scheduler().timer_alloc(FUNC(dmaend_callback)); | |
488 | m_dmadelay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(xexex_state::dmaend_callback),this)); | |
490 | 489 | } |
491 | 490 | |
492 | 491 | void xexex_state::machine_reset() |
r18112 | r18113 | |
---|---|---|
322 | 322 | |
323 | 323 | /* 68000 A */ |
324 | 324 | |
325 | ||
325 | TIMER_CALLBACK_MEMBER(topspeed_state::topspeed_interrupt6) | |
326 | 326 | { |
327 | topspeed_state *state = machine.driver_data<topspeed_state>(); | |
328 | state->m_maincpu->set_input_line(6, HOLD_LINE); | |
327 | m_maincpu->set_input_line(6, HOLD_LINE); | |
329 | 328 | } |
330 | 329 | |
331 | 330 | /* 68000 B */ |
332 | 331 | |
333 | ||
332 | TIMER_CALLBACK_MEMBER(topspeed_state::topspeed_cpub_interrupt6) | |
334 | 333 | { |
335 | topspeed_state *state = machine.driver_data<topspeed_state>(); | |
336 | state->m_subcpu->set_input_line(6, HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */ | |
334 | m_subcpu->set_input_line(6, HOLD_LINE); /* assumes Z80 sandwiched between the 68Ks */ | |
337 | 335 | } |
338 | 336 | |
339 | 337 | |
340 | 338 | INTERRUPT_GEN_MEMBER(topspeed_state::topspeed_interrupt) |
341 | 339 | { |
342 | 340 | /* Unsure how many int6's per frame */ |
343 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000 - 500), FUNC(topspeed_interrupt6)); | |
341 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000 - 500), timer_expired_delegate(FUNC(topspeed_state::topspeed_interrupt6),this)); | |
344 | 342 | device.execute().set_input_line(5, HOLD_LINE); |
345 | 343 | } |
346 | 344 | |
347 | 345 | INTERRUPT_GEN_MEMBER(topspeed_state::topspeed_cpub_interrupt) |
348 | 346 | { |
349 | 347 | /* Unsure how many int6's per frame */ |
350 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000 - 500), FUNC(topspeed_cpub_interrupt6)); | |
348 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000 - 500), timer_expired_delegate(FUNC(topspeed_state::topspeed_cpub_interrupt6),this)); | |
351 | 349 | device.execute().set_input_line(5, HOLD_LINE); |
352 | 350 | } |
353 | 351 |
r18112 | r18113 | |
---|---|---|
28 | 28 | device.execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE); |
29 | 29 | } |
30 | 30 | |
31 | ||
31 | TIMER_CALLBACK_MEMBER(thunderx_state::thunderx_firq_callback) | |
32 | 32 | { |
33 | thunderx_state *state = machine.driver_data<thunderx_state>(); | |
34 | state->m_maincpu->set_input_line(KONAMI_FIRQ_LINE, HOLD_LINE); | |
33 | m_maincpu->set_input_line(KONAMI_FIRQ_LINE, HOLD_LINE); | |
35 | 34 | } |
36 | 35 | |
37 | 36 | READ8_MEMBER(thunderx_state::scontra_bankedram_r) |
r18112 | r18113 | |
306 | 305 | calculate_collisions(machine()); |
307 | 306 | |
308 | 307 | /* 100 cycle delay is arbitrary */ |
309 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(100), FUNC(thunderx_firq_callback)); | |
308 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(100), timer_expired_delegate(FUNC(thunderx_state::thunderx_firq_callback),this)); | |
310 | 309 | } |
311 | 310 | |
312 | 311 | m_1f98_data = data; |
r18112 | r18113 | |
---|---|---|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | ||
47 | TIMER_CALLBACK_MEMBER(videopin_state::interrupt_callback) | |
48 | 48 | { |
49 | 49 | int scanline = param; |
50 | 50 | |
51 | update_plunger(machine); | |
51 | update_plunger(machine()); | |
52 | 52 | |
53 | machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
53 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
54 | 54 | |
55 | 55 | scanline = scanline + 32; |
56 | 56 | |
57 | 57 | if (scanline >= 263) |
58 | 58 | scanline = 32; |
59 | 59 | |
60 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(interrupt_callback), scanline); | |
60 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(videopin_state::interrupt_callback),this), scanline); | |
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | void videopin_state::machine_reset() |
65 | 65 | { |
66 | 66 | |
67 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(32), FUNC(interrupt_callback), 32); | |
67 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(32), timer_expired_delegate(FUNC(videopin_state::interrupt_callback),this), 32); | |
68 | 68 | |
69 | 69 | /* both output latches are cleared on reset */ |
70 | 70 |
r18112 | r18113 | |
---|---|---|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
44 | ||
44 | TIMER_CALLBACK_MEMBER(ultratnk_state::nmi_callback) | |
45 | 45 | { |
46 | 46 | int scanline = param + 64; |
47 | 47 | |
r18112 | r18113 | |
50 | 50 | |
51 | 51 | /* NMI and watchdog are disabled during service mode */ |
52 | 52 | |
53 | machine.watchdog_enable(machine.root_device().ioport("IN0")->read() & 0x40); | |
53 | machine().watchdog_enable(machine().root_device().ioport("IN0")->read() & 0x40); | |
54 | 54 | |
55 | if (machine.root_device().ioport("IN0")->read() & 0x40) | |
56 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
55 | if (machine().root_device().ioport("IN0")->read() & 0x40) | |
56 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
57 | 57 | |
58 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(nmi_callback), scanline); | |
58 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(ultratnk_state::nmi_callback),this), scanline); | |
59 | 59 | } |
60 | 60 | |
61 | 61 | |
62 | 62 | void ultratnk_state::machine_reset() |
63 | 63 | { |
64 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(32), FUNC(nmi_callback), 32); | |
64 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(32), timer_expired_delegate(FUNC(ultratnk_state::nmi_callback),this), 32); | |
65 | 65 | } |
66 | 66 | |
67 | 67 |
r18112 | r18113 | |
---|---|---|
182 | 182 | return m_from_mcu; |
183 | 183 | } |
184 | 184 | |
185 | ||
185 | TIMER_CALLBACK_MEMBER(superqix_state::mcu_acknowledge_callback) | |
186 | 186 | { |
187 | superqix_state *state = machine.driver_data<superqix_state>(); | |
188 | state->m_from_z80_pending = 1; | |
189 | state->m_from_z80 = state->m_portb; | |
190 | // logerror("Z80->MCU %02x\n",state->m_from_z80); | |
187 | m_from_z80_pending = 1; | |
188 | m_from_z80 = m_portb; | |
189 | // logerror("Z80->MCU %02x\n",m_from_z80); | |
191 | 190 | } |
192 | 191 | |
193 | 192 | READ8_MEMBER(superqix_state::mcu_acknowledge_r) |
194 | 193 | { |
195 | machine().scheduler().synchronize(FUNC(mcu_acknowledge_callback)); | |
194 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(superqix_state::mcu_acknowledge_callback),this)); | |
196 | 195 | return 0; |
197 | 196 | } |
198 | 197 | |
r18112 | r18113 | |
364 | 363 | |
365 | 364 | |
366 | 365 | |
367 | ||
366 | TIMER_CALLBACK_MEMBER(superqix_state::delayed_z80_mcu_w) | |
368 | 367 | { |
369 | superqix_state *state = machine.driver_data<superqix_state>(); | |
370 | 368 | // logerror("Z80 sends command %02x\n",param); |
371 | state->m_from_z80 = param; | |
372 | state->m_from_mcu_pending = 0; | |
373 | machine.device("mcu")->execute().set_input_line(0, HOLD_LINE); | |
374 | machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(200)); | |
369 | m_from_z80 = param; | |
370 | m_from_mcu_pending = 0; | |
371 | machine().device("mcu")->execute().set_input_line(0, HOLD_LINE); | |
372 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(200)); | |
375 | 373 | } |
376 | 374 | |
377 | ||
375 | TIMER_CALLBACK_MEMBER(superqix_state::delayed_mcu_z80_w) | |
378 | 376 | { |
379 | superqix_state *state = machine.driver_data<superqix_state>(); | |
380 | 377 | // logerror("68705 sends answer %02x\n",param); |
381 | state->m_from_mcu = param; | |
382 | state->m_from_mcu_pending = 1; | |
378 | m_from_mcu = param; | |
379 | m_from_mcu_pending = 1; | |
383 | 380 | } |
384 | 381 | |
385 | 382 | |
r18112 | r18113 | |
445 | 442 | break; |
446 | 443 | |
447 | 444 | case 0x5: // answer to Z80 |
448 | machine().scheduler().synchronize(FUNC(delayed_mcu_z80_w), m_portB_out); | |
445 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(superqix_state::delayed_mcu_z80_w),this), m_portB_out); | |
449 | 446 | break; |
450 | 447 | |
451 | 448 | case 0x6: |
r18112 | r18113 | |
461 | 458 | |
462 | 459 | WRITE8_MEMBER(superqix_state::hotsmash_z80_mcu_w) |
463 | 460 | { |
464 | machine().scheduler().synchronize(FUNC(delayed_z80_mcu_w), data); | |
461 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(superqix_state::delayed_z80_mcu_w),this), data); | |
465 | 462 | } |
466 | 463 | |
467 | 464 | READ8_MEMBER(superqix_state::hotsmash_from_mcu_r) |
r18112 | r18113 | |
---|---|---|
130 | 130 | PORT_BIT( 0xff80, IP_ACTIVE_LOW, IPT_UNUSED ) |
131 | 131 | INPUT_PORTS_END |
132 | 132 | |
133 | ||
133 | TIMER_CALLBACK_MEMBER(rltennis_state::sample_player) | |
134 | 134 | { |
135 | rltennis_state *state = machine.driver_data<rltennis_state>(); | |
136 | 135 | |
137 | if(( | |
136 | if((m_dac_counter&0x7ff) == 0x7ff) /* reload top address bits */ | |
138 | 137 | { |
139 | state->m_sample_rom_offset_1=(( state->m_data740000 >> state->m_offset_shift ) & 0xff )<<11; | |
140 | state->m_sample_rom_offset_2=(( state->m_data760000 >> state->m_offset_shift ) & 0xff )<<11; | |
141 | state->m_offset_shift^=8; /* switch between MSB and LSB */ | |
138 | m_sample_rom_offset_1=(( m_data740000 >> m_offset_shift ) & 0xff )<<11; | |
139 | m_sample_rom_offset_2=(( m_data760000 >> m_offset_shift ) & 0xff )<<11; | |
140 | m_offset_shift^=8; /* switch between MSB and LSB */ | |
142 | 141 | } |
143 | ++ | |
142 | ++m_dac_counter; /* update low address bits */ | |
144 | 143 | |
145 | state->m_dac_1->write_signed8(state->m_samples_1[state->m_sample_rom_offset_1 + ( state->m_dac_counter&0x7ff )]); | |
146 | state->m_dac_2->write_unsigned8(state->m_samples_2[state->m_sample_rom_offset_2 + ( state->m_dac_counter&0x7ff )]); | |
147 | state->m_timer->adjust(attotime::from_hz( RLT_TIMER_FREQ )); | |
144 | m_dac_1->write_signed8(m_samples_1[m_sample_rom_offset_1 + ( m_dac_counter&0x7ff )]); | |
145 | m_dac_2->write_unsigned8(m_samples_2[m_sample_rom_offset_2 + ( m_dac_counter&0x7ff )]); | |
146 | m_timer->adjust(attotime::from_hz( RLT_TIMER_FREQ )); | |
148 | 147 | } |
149 | 148 | |
150 | 149 | INTERRUPT_GEN_MEMBER(rltennis_state::rltennis_interrupt) |
r18112 | r18113 | |
163 | 162 | m_samples_1 = memregion("samples1")->base(); |
164 | 163 | m_samples_2 = memregion("samples2")->base(); |
165 | 164 | m_gfx = memregion("gfx1")->base(); |
166 | m_timer = machine().scheduler().timer_alloc(FUNC(sample_player)); | |
165 | m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rltennis_state::sample_player),this)); | |
167 | 166 | } |
168 | 167 | |
169 | 168 | void rltennis_state::machine_reset() |
r18112 | r18113 | |
---|---|---|
119 | 119 | * |
120 | 120 | *************************************/ |
121 | 121 | |
122 | ||
122 | TIMER_CALLBACK_MEMBER(capbowl_state::capbowl_update) | |
123 | 123 | { |
124 | 124 | int scanline = param; |
125 | 125 | |
126 | machine.primary_screen->update_partial(scanline - 1); | |
126 | machine().primary_screen->update_partial(scanline - 1); | |
127 | 127 | scanline += 32; |
128 | 128 | if (scanline > 240) scanline = 32; |
129 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(capbowl_update), scanline); | |
129 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(capbowl_state::capbowl_update),this), scanline); | |
130 | 130 | } |
131 | 131 | |
132 | 132 | |
r18112 | r18113 | |
348 | 348 | void capbowl_state::machine_reset() |
349 | 349 | { |
350 | 350 | |
351 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(32), FUNC(capbowl_update), 32); | |
351 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(32), timer_expired_delegate(FUNC(capbowl_state::capbowl_update),this), 32); | |
352 | 352 | |
353 | 353 | m_blitter_addr = 0; |
354 | 354 | m_last_trackball_val[0] = 0; |
r18112 | r18113 | |
---|---|---|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
62 | ||
62 | TIMER_CALLBACK_MEMBER(fromance_state::deferred_commanddata_w) | |
63 | 63 | { |
64 | fromance_state *state = machine.driver_data<fromance_state>(); | |
65 | state->m_commanddata = param; | |
66 | state->m_directionflag = 1; | |
64 | m_commanddata = param; | |
65 | m_directionflag = 1; | |
67 | 66 | } |
68 | 67 | |
69 | 68 | |
70 | 69 | WRITE8_MEMBER(fromance_state::fromance_commanddata_w) |
71 | 70 | { |
72 | 71 | /* do this on a timer to let the slave CPU synchronize */ |
73 | machine().scheduler().synchronize(FUNC(deferred_commanddata_w), data); | |
72 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(fromance_state::deferred_commanddata_w),this), data); | |
74 | 73 | } |
75 | 74 | |
76 | 75 |
r18112 | r18113 | |
---|---|---|
157 | 157 | GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x80, 8 ) |
158 | 158 | GFXDECODE_END |
159 | 159 | |
160 | ||
160 | TIMER_CALLBACK_MEMBER(mustache_state::clear_irq_cb) | |
161 | 161 | { |
162 | machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE); | |
162 | machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE); | |
163 | 163 | } |
164 | 164 | |
165 | 165 | INTERRUPT_GEN_MEMBER(mustache_state::assert_irq) |
r18112 | r18113 | |
179 | 179 | |
180 | 180 | void mustache_state::machine_start() |
181 | 181 | { |
182 | m_clear_irq_timer = machine().scheduler().timer_alloc(FUNC(clear_irq_cb)); | |
182 | m_clear_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mustache_state::clear_irq_cb),this)); | |
183 | 183 | } |
184 | 184 | |
185 | 185 | static MACHINE_CONFIG_START( mustache, mustache_state ) |
r18112 | r18113 | |
---|---|---|
564 | 564 | } |
565 | 565 | |
566 | 566 | |
567 | ||
567 | TIMER_CALLBACK_MEMBER(turbo_state::delayed_i8255_w) | |
568 | 568 | { |
569 | turbo_state *state = machine.driver_data<turbo_state>(); | |
570 | state->m_i8255_0->write(state->m_maincpu->space(AS_PROGRAM), param >> 8, param & 0xff); | |
569 | m_i8255_0->write(m_maincpu->space(AS_PROGRAM), param >> 8, param & 0xff); | |
571 | 570 | } |
572 | 571 | |
573 | 572 | |
r18112 | r18113 | |
575 | 574 | { |
576 | 575 | /* the port C handshaking signals control the sub CPU IRQ, */ |
577 | 576 | /* so we have to sync whenever we access this PPI */ |
578 | machine().scheduler().synchronize(FUNC(delayed_i8255_w), ((offset & 3) << 8) | (data & 0xff)); | |
577 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(turbo_state::delayed_i8255_w),this), ((offset & 3) << 8) | (data & 0xff)); | |
579 | 578 | } |
580 | 579 | |
581 | 580 |
r18112 | r18113 | |
---|---|---|
91 | 91 | membank("bank1")->set_entry(data & 0x07); // shall we check if data&7 < # banks? |
92 | 92 | } |
93 | 93 | |
94 | ||
94 | TIMER_CALLBACK_MEMBER(buggychl_state::nmi_callback) | |
95 | 95 | { |
96 | buggychl_state *state = machine.driver_data<buggychl_state>(); | |
97 | 96 | |
98 | if (state->m_sound_nmi_enable) | |
99 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
97 | if (m_sound_nmi_enable) | |
98 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
100 | 99 | else |
101 | | |
100 | m_pending_nmi = 1; | |
102 | 101 | } |
103 | 102 | |
104 | 103 | WRITE8_MEMBER(buggychl_state::sound_command_w) |
105 | 104 | { |
106 | 105 | soundlatch_byte_w(space, 0, data); |
107 | machine().scheduler().synchronize(FUNC(nmi_callback), data); | |
106 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(buggychl_state::nmi_callback),this), data); | |
108 | 107 | } |
109 | 108 | |
110 | 109 | WRITE8_MEMBER(buggychl_state::nmi_disable_w) |
r18112 | r18113 | |
---|---|---|
572 | 572 | |
573 | 573 | ******************************************************************/ |
574 | 574 | |
575 | ||
575 | TIMER_CALLBACK_MEMBER(taitof2_state::taitof2_interrupt6) | |
576 | 576 | { |
577 | taitof2_state *state = machine.driver_data<taitof2_state>(); | |
578 | state->m_maincpu->set_input_line(6, HOLD_LINE); | |
577 | m_maincpu->set_input_line(6, HOLD_LINE); | |
579 | 578 | } |
580 | 579 | |
581 | 580 | INTERRUPT_GEN_MEMBER(taitof2_state::taitof2_interrupt) |
582 | 581 | { |
583 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(500), FUNC(taitof2_interrupt6)); | |
582 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(500), timer_expired_delegate(FUNC(taitof2_state::taitof2_interrupt6),this)); | |
584 | 583 | device.execute().set_input_line(5, HOLD_LINE); |
585 | 584 | } |
586 | 585 |
r18112 | r18113 | |
---|---|---|
220 | 220 | * |
221 | 221 | *************************************/ |
222 | 222 | |
223 | static TIMER_CALLBACK( laserdisc_bit_callback ); | |
224 | static TIMER_CALLBACK( laserdisc_philips_callback ); | |
225 | 223 | |
226 | 224 | |
227 | 225 | |
228 | 226 | |
229 | 227 | |
230 | 228 | |
229 | ||
230 | ||
231 | 231 | /************************************* |
232 | 232 | * |
233 | 233 | * Initialization |
r18112 | r18113 | |
249 | 249 | machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x05806, 0x05806, 0, 0x07f8, write8_delegate(FUNC(gottlieb_state::laserdisc_select_w),this)); |
250 | 250 | |
251 | 251 | /* allocate a timer for serial transmission, and one for philips code processing */ |
252 | m_laserdisc_bit_timer = machine().scheduler().timer_alloc(FUNC(laserdisc_bit_callback)); | |
253 | m_laserdisc_philips_timer = machine().scheduler().timer_alloc(FUNC(laserdisc_philips_callback)); | |
252 | m_laserdisc_bit_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gottlieb_state::laserdisc_bit_callback),this)); | |
253 | m_laserdisc_philips_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gottlieb_state::laserdisc_philips_callback),this)); | |
254 | 254 | |
255 | 255 | /* create some audio RAM */ |
256 | 256 | m_laserdisc_audio_buffer = auto_alloc_array(machine(), UINT8, AUDIORAM_SIZE); |
r18112 | r18113 | |
420 | 420 | * |
421 | 421 | *************************************/ |
422 | 422 | |
423 | ||
423 | TIMER_CALLBACK_MEMBER(gottlieb_state::laserdisc_philips_callback) | |
424 | 424 | { |
425 | gottlieb_state *state = machine.driver_data<gottlieb_state>(); | |
426 | UINT32 newcode = state->m_laserdisc->get_field_code((param == 17) ? LASERDISC_CODE_LINE17 : LASERDISC_CODE_LINE18, TRUE); | |
425 | UINT32 newcode = m_laserdisc->get_field_code((param == 17) ? LASERDISC_CODE_LINE17 : LASERDISC_CODE_LINE18, TRUE); | |
427 | 426 | |
428 | 427 | /* the PR8210 sends line 17/18 data on each frame; the laserdisc interface |
429 | 428 | board receives notification and latches the most recent frame number */ |
r18112 | r18113 | |
431 | 430 | /* the logic detects a valid code when the top 4 bits are all 1s */ |
432 | 431 | if ((newcode & 0xf00000) == 0xf00000) |
433 | 432 | { |
434 | state->m_laserdisc_philips_code = newcode; | |
435 | state->m_laserdisc_status = (state->m_laserdisc_status & ~0x07) | ((newcode >> 16) & 7); | |
433 | m_laserdisc_philips_code = newcode; | |
434 | m_laserdisc_status = (m_laserdisc_status & ~0x07) | ((newcode >> 16) & 7); | |
436 | 435 | } |
437 | 436 | |
438 | 437 | /* toggle to the next one */ |
439 | 438 | param = (param == 17) ? 18 : 17; |
440 | | |
439 | m_laserdisc_philips_timer->adjust(machine().primary_screen->time_until_pos(param * 2), param); | |
441 | 440 | } |
442 | 441 | |
443 | 442 | |
444 | ||
443 | TIMER_CALLBACK_MEMBER(gottlieb_state::laserdisc_bit_off_callback) | |
445 | 444 | { |
446 | gottlieb_state *state = machine.driver_data<gottlieb_state>(); | |
447 | 445 | /* deassert the control line */ |
448 | | |
446 | m_laserdisc->control_w(CLEAR_LINE); | |
449 | 447 | } |
450 | 448 | |
451 | 449 | |
452 | ||
450 | TIMER_CALLBACK_MEMBER(gottlieb_state::laserdisc_bit_callback) | |
453 | 451 | { |
454 | gottlieb_state *state = machine.driver_data<gottlieb_state>(); | |
455 | 452 | UINT8 bitsleft = param >> 16; |
456 | 453 | UINT8 data = param; |
457 | 454 | attotime duration; |
458 | 455 | |
459 | 456 | /* assert the line and set a timer for deassertion */ |
460 | state->m_laserdisc->control_w(ASSERT_LINE); | |
461 | machine.scheduler().timer_set(LASERDISC_CLOCK * 10, FUNC(laserdisc_bit_off_callback)); | |
457 | m_laserdisc->control_w(ASSERT_LINE); | |
458 | machine().scheduler().timer_set(LASERDISC_CLOCK * 10, timer_expired_delegate(FUNC(gottlieb_state::laserdisc_bit_off_callback),this)); | |
462 | 459 | |
463 | 460 | /* determine how long for the next command; there is a 555 timer with a |
464 | 461 | variable resistor controlling the timing of the pulses. Nominally, the |
r18112 | r18113 | |
470 | 467 | |
471 | 468 | /* if we're not out of bits, set a timer for the next one; else set the ready bit */ |
472 | 469 | if (bitsleft-- != 0) |
473 | | |
470 | m_laserdisc_bit_timer->adjust(duration, (bitsleft << 16) | data); | |
474 | 471 | else |
475 | | |
472 | m_laserdisc_status |= 0x10; | |
476 | 473 | } |
477 | 474 | |
478 | 475 | |
r18112 | r18113 | |
651 | 648 | * |
652 | 649 | *************************************/ |
653 | 650 | |
654 | ||
651 | TIMER_CALLBACK_MEMBER(gottlieb_state::nmi_clear) | |
655 | 652 | { |
656 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); | |
653 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); | |
657 | 654 | } |
658 | 655 | |
659 | 656 | |
r18112 | r18113 | |
661 | 658 | { |
662 | 659 | /* assert the NMI and set a timer to clear it at the first visible line */ |
663 | 660 | device.execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); |
664 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), FUNC(nmi_clear)); | |
661 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(gottlieb_state::nmi_clear),this)); | |
665 | 662 | |
666 | 663 | /* if we have a laserdisc, update it */ |
667 | 664 | if (m_laserdisc != NULL) |
r18112 | r18113 | |
---|---|---|
67 | 67 | #define COIN_PORT_TAG "COIN" |
68 | 68 | |
69 | 69 | |
70 | ||
70 | TIMER_CALLBACK_MEMBER(vicdual_state::clear_coin_status) | |
71 | 71 | { |
72 | vicdual_state *state = machine.driver_data<vicdual_state>(); | |
73 | state->m_coin_status = 0; | |
72 | m_coin_status = 0; | |
74 | 73 | } |
75 | 74 | |
76 | 75 | |
r18112 | r18113 | |
98 | 97 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); |
99 | 98 | |
100 | 99 | /* simulate the coin switch being closed for a while */ |
101 | machine().scheduler().timer_set(4 * machine().primary_screen->frame_period(), FUNC(clear_coin_status)); | |
100 | machine().scheduler().timer_set(4 * machine().primary_screen->frame_period(), timer_expired_delegate(FUNC(vicdual_state::clear_coin_status),this)); | |
102 | 101 | } |
103 | 102 | } |
104 | 103 |
r18112 | r18113 | |
---|---|---|
98 | 98 | INTERRUPTS |
99 | 99 | ***********************************************************/ |
100 | 100 | |
101 | ||
101 | TIMER_CALLBACK_MEMBER(groundfx_state::groundfx_interrupt5) | |
102 | 102 | { |
103 | machine.device("maincpu")->execute().set_input_line(5, HOLD_LINE); //from 5... ADC port | |
103 | machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE); //from 5... ADC port | |
104 | 104 | } |
105 | 105 | |
106 | 106 | |
r18112 | r18113 | |
173 | 173 | { |
174 | 174 | /* One interrupt per input port (4 per frame, though only 2 used). |
175 | 175 | 1000 cycle delay is arbitrary */ |
176 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), FUNC(groundfx_interrupt5)); | |
176 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), timer_expired_delegate(FUNC(groundfx_state::groundfx_interrupt5),this)); | |
177 | 177 | } |
178 | 178 | |
179 | 179 | WRITE32_MEMBER(groundfx_state::rotate_control_w)/* only a guess that it's rotation */ |
r18112 | r18113 | |
---|---|---|
97 | 97 | |
98 | 98 | |
99 | 99 | |
100 | static TIMER_CALLBACK( m72_scanline_interrupt ); | |
101 | static TIMER_CALLBACK( kengo_scanline_interrupt ); | |
102 | 100 | |
101 | ||
102 | ||
103 | 103 | /***************************************************************************/ |
104 | 104 | |
105 | 105 | MACHINE_START_MEMBER(m72_state,m72) |
106 | 106 | { |
107 | 107 | m_audio = machine().device("m72"); |
108 | m_scanline_timer = machine().scheduler().timer_alloc(FUNC(m72_scanline_interrupt)); | |
108 | m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m72_state::m72_scanline_interrupt),this)); | |
109 | 109 | |
110 | 110 | save_item(NAME(m_mcu_sample_addr)); |
111 | 111 | save_item(NAME(m_mcu_snd_cmd_latch)); |
r18112 | r18113 | |
113 | 113 | |
114 | 114 | MACHINE_START_MEMBER(m72_state,kengo) |
115 | 115 | { |
116 | m_scanline_timer = machine().scheduler().timer_alloc(FUNC(kengo_scanline_interrupt)); | |
116 | m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(m72_state::kengo_scanline_interrupt),this)); | |
117 | 117 | |
118 | 118 | save_item(NAME(m_mcu_sample_addr)); |
119 | 119 | save_item(NAME(m_mcu_snd_cmd_latch)); |
120 | 120 | } |
121 | 121 | |
122 | ||
122 | TIMER_CALLBACK_MEMBER(m72_state::synch_callback) | |
123 | 123 | { |
124 | //machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(8000000)); | |
125 | machine.scheduler().boost_interleave(attotime::from_hz(MASTER_CLOCK/4/12), attotime::from_seconds(25)); | |
124 | //machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(8000000)); | |
125 | machine().scheduler().boost_interleave(attotime::from_hz(MASTER_CLOCK/4/12), attotime::from_seconds(25)); | |
126 | 126 | } |
127 | 127 | |
128 | 128 | MACHINE_RESET_MEMBER(m72_state,m72) |
r18112 | r18113 | |
132 | 132 | m_mcu_snd_cmd_latch = 0; |
133 | 133 | |
134 | 134 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(0)); |
135 | machine().scheduler().synchronize(FUNC(synch_callback)); | |
135 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(m72_state::synch_callback),this)); | |
136 | 136 | } |
137 | 137 | |
138 | 138 | MACHINE_RESET_MEMBER(m72_state,xmultipl) |
r18112 | r18113 | |
146 | 146 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(0)); |
147 | 147 | } |
148 | 148 | |
149 | ||
149 | TIMER_CALLBACK_MEMBER(m72_state::m72_scanline_interrupt) | |
150 | 150 | { |
151 | m72_state *state = machine.driver_data<m72_state>(); | |
152 | 151 | int scanline = param; |
153 | 152 | |
154 | 153 | /* raster interrupt - visible area only? */ |
155 | if (scanline < 256 && scanline == | |
154 | if (scanline < 256 && scanline == m_raster_irq_position - 128) | |
156 | 155 | { |
157 | machine.primary_screen->update_partial(scanline); | |
158 | machine.device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, state->m_irq_base + 2); | |
156 | machine().primary_screen->update_partial(scanline); | |
157 | machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, m_irq_base + 2); | |
159 | 158 | } |
160 | 159 | |
161 | 160 | /* VBLANK interrupt */ |
162 | 161 | else if (scanline == 256) |
163 | 162 | { |
164 | machine.primary_screen->update_partial(scanline); | |
165 | machine.device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, state->m_irq_base + 0); | |
163 | machine().primary_screen->update_partial(scanline); | |
164 | machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, m_irq_base + 0); | |
166 | 165 | } |
167 | 166 | |
168 | 167 | /* adjust for next scanline */ |
169 | if (++scanline >= machine.primary_screen->height()) | |
168 | if (++scanline >= machine().primary_screen->height()) | |
170 | 169 | scanline = 0; |
171 | | |
170 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
172 | 171 | } |
173 | 172 | |
174 | ||
173 | TIMER_CALLBACK_MEMBER(m72_state::kengo_scanline_interrupt) | |
175 | 174 | { |
176 | m72_state *state = machine.driver_data<m72_state>(); | |
177 | 175 | int scanline = param; |
178 | 176 | |
179 | 177 | /* raster interrupt - visible area only? */ |
180 | if (scanline < 256 && scanline == | |
178 | if (scanline < 256 && scanline == m_raster_irq_position - 128) | |
181 | 179 | { |
182 | machine.primary_screen->update_partial(scanline); | |
183 | machine.device("maincpu")->execute().set_input_line(NEC_INPUT_LINE_INTP2, ASSERT_LINE); | |
180 | machine().primary_screen->update_partial(scanline); | |
181 | machine().device("maincpu")->execute().set_input_line(NEC_INPUT_LINE_INTP2, ASSERT_LINE); | |
184 | 182 | } |
185 | 183 | else |
186 | machine.device("maincpu")->execute().set_input_line(NEC_INPUT_LINE_INTP2, CLEAR_LINE); | |
184 | machine().device("maincpu")->execute().set_input_line(NEC_INPUT_LINE_INTP2, CLEAR_LINE); | |
187 | 185 | |
188 | 186 | /* VBLANK interrupt */ |
189 | 187 | if (scanline == 256) |
190 | 188 | { |
191 | machine.primary_screen->update_partial(scanline); | |
192 | machine.device("maincpu")->execute().set_input_line(NEC_INPUT_LINE_INTP0, ASSERT_LINE); | |
189 | machine().primary_screen->update_partial(scanline); | |
190 | machine().device("maincpu")->execute().set_input_line(NEC_INPUT_LINE_INTP0, ASSERT_LINE); | |
193 | 191 | } |
194 | 192 | else |
195 | machine.device("maincpu")->execute().set_input_line(NEC_INPUT_LINE_INTP0, CLEAR_LINE); | |
193 | machine().device("maincpu")->execute().set_input_line(NEC_INPUT_LINE_INTP0, CLEAR_LINE); | |
196 | 194 | |
197 | 195 | /* adjust for next scanline */ |
198 | if (++scanline >= machine.primary_screen->height()) | |
196 | if (++scanline >= machine().primary_screen->height()) | |
199 | 197 | scanline = 0; |
200 | | |
198 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
201 | 199 | } |
202 | 200 | |
203 | 201 | /*************************************************************************** |
r18112 | r18113 | |
215 | 213 | |
216 | 214 | ***************************************************************************/ |
217 | 215 | |
218 | ||
216 | TIMER_CALLBACK_MEMBER(m72_state::delayed_ram16_w) | |
219 | 217 | { |
220 | 218 | UINT16 val = ((UINT32) param) & 0xffff; |
221 | 219 | UINT16 offset = (((UINT32) param) >> 16) & 0xffff; |
r18112 | r18113 | |
256 | 254 | //machine().scheduler().timer_set(machine().device<cpu_device>("mcu")->cycles_to_attotime(0), FUNC(mcu_irq0_raise)); |
257 | 255 | } |
258 | 256 | else |
259 | machine().scheduler().synchronize( FUNC(delayed_ram16_w), (offset<<16) | val, m_protection_ram); | |
257 | machine().scheduler().synchronize( timer_expired_delegate(FUNC(m72_state::delayed_ram16_w),this), (offset<<16) | val, m_protection_ram); | |
260 | 258 | } |
261 | 259 | |
262 | 260 | WRITE8_MEMBER(m72_state::m72_mcu_data_w) |
r18112 | r18113 | |
265 | 263 | if (offset&1) val = (m_protection_ram[offset/2] & 0x00ff) | (data << 8); |
266 | 264 | else val = (m_protection_ram[offset/2] & 0xff00) | (data&0xff); |
267 | 265 | |
268 | machine().scheduler().synchronize( FUNC(delayed_ram16_w), ((offset >>1 ) << 16) | val, m_protection_ram); | |
266 | machine().scheduler().synchronize( timer_expired_delegate(FUNC(m72_state::delayed_ram16_w),this), ((offset >>1 ) << 16) | val, m_protection_ram); | |
269 | 267 | } |
270 | 268 | |
271 | 269 | READ8_MEMBER(m72_state::m72_mcu_data_r) |
r18112 | r18113 | |
---|---|---|
414 | 414 | also used for water effects and titlescreen linescroll on gogomile |
415 | 415 | */ |
416 | 416 | |
417 | ||
417 | TIMER_CALLBACK_MEMBER(fuuki16_state::level_1_interrupt_callback) | |
418 | 418 | { |
419 | fuuki16_state *state = machine.driver_data<fuuki16_state>(); | |
420 | state->m_maincpu->set_input_line(1, HOLD_LINE); | |
421 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback)); | |
419 | m_maincpu->set_input_line(1, HOLD_LINE); | |
420 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(248), timer_expired_delegate(FUNC(fuuki16_state::level_1_interrupt_callback),this)); | |
422 | 421 | } |
423 | 422 | |
424 | 423 | |
425 | ||
424 | TIMER_CALLBACK_MEMBER(fuuki16_state::vblank_interrupt_callback) | |
426 | 425 | { |
427 | fuuki16_state *state = machine.driver_data<fuuki16_state>(); | |
428 | state->m_maincpu->set_input_line(3, HOLD_LINE); // VBlank IRQ | |
429 | machine.scheduler().timer_set(machine.primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback)); | |
426 | m_maincpu->set_input_line(3, HOLD_LINE); // VBlank IRQ | |
427 | machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_start(), timer_expired_delegate(FUNC(fuuki16_state::vblank_interrupt_callback),this)); | |
430 | 428 | } |
431 | 429 | |
432 | 430 | |
433 | ||
431 | TIMER_CALLBACK_MEMBER(fuuki16_state::raster_interrupt_callback) | |
434 | 432 | { |
435 | fuuki16_state *state = machine.driver_data<fuuki16_state>(); | |
436 | state->m_maincpu->set_input_line(5, HOLD_LINE); // Raster Line IRQ | |
437 | machine.primary_screen->update_partial(machine.primary_screen->vpos()); | |
438 | state->m_raster_interrupt_timer->adjust(machine.primary_screen->frame_period()); | |
433 | m_maincpu->set_input_line(5, HOLD_LINE); // Raster Line IRQ | |
434 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); | |
435 | m_raster_interrupt_timer->adjust(machine().primary_screen->frame_period()); | |
439 | 436 | } |
440 | 437 | |
441 | 438 | |
r18112 | r18113 | |
448 | 445 | m_maincpu = machine().device<cpu_device>("maincpu"); |
449 | 446 | m_audiocpu = machine().device<cpu_device>("audiocpu"); |
450 | 447 | |
451 | m_raster_interrupt_timer = machine().scheduler().timer_alloc(FUNC(raster_interrupt_callback)); | |
448 | m_raster_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fuuki16_state::raster_interrupt_callback),this)); | |
452 | 449 | } |
453 | 450 | |
454 | 451 | |
r18112 | r18113 | |
456 | 453 | { |
457 | 454 | const rectangle &visarea = machine().primary_screen->visible_area(); |
458 | 455 | |
459 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback)); | |
460 | machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback)); | |
456 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(248), timer_expired_delegate(FUNC(fuuki16_state::level_1_interrupt_callback),this)); | |
457 | machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_start(), timer_expired_delegate(FUNC(fuuki16_state::vblank_interrupt_callback),this)); | |
461 | 458 | m_raster_interrupt_timer->adjust(machine().primary_screen->time_until_pos(0, visarea.max_x + 1)); |
462 | 459 | } |
463 | 460 |
r18112 | r18113 | |
---|---|---|
124 | 124 | *************************************/ |
125 | 125 | |
126 | 126 | |
127 | ||
127 | TIMER_CALLBACK_MEMBER(spacefb_state::interrupt_callback) | |
128 | 128 | { |
129 | spacefb_state *state = machine.driver_data<spacefb_state>(); | |
130 | 129 | int next_vpos; |
131 | 130 | |
132 | 131 | /* compute vector and set the interrupt line */ |
133 | int vpos = machine.primary_screen->vpos(); | |
132 | int vpos = machine().primary_screen->vpos(); | |
134 | 133 | UINT8 vector = 0xc7 | ((vpos & 0x40) >> 2) | ((~vpos & 0x40) >> 3); |
135 | machine.device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, vector); | |
134 | machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, vector); | |
136 | 135 | |
137 | 136 | /* set up for next interrupt */ |
138 | 137 | if (vpos == SPACEFB_INT_TRIGGER_COUNT_1) |
r18112 | r18113 | |
140 | 139 | else |
141 | 140 | next_vpos = SPACEFB_INT_TRIGGER_COUNT_1; |
142 | 141 | |
143 | | |
142 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(next_vpos)); | |
144 | 143 | } |
145 | 144 | |
146 | 145 | |
147 | 146 | static void create_interrupt_timer(running_machine &machine) |
148 | 147 | { |
149 | 148 | spacefb_state *state = machine.driver_data<spacefb_state>(); |
150 | state->m_interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_callback)); | |
149 | state->m_interrupt_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(spacefb_state::interrupt_callback),state)); | |
151 | 150 | } |
152 | 151 | |
153 | 152 |
r18112 | r18113 | |
---|---|---|
234 | 234 | machine().device("sub")->execute().set_input_line(0, CLEAR_LINE); |
235 | 235 | } |
236 | 236 | |
237 | ||
237 | TIMER_CALLBACK_MEMBER(gaplus_state::namcoio_run) | |
238 | 238 | { |
239 | device_t *io58xx = machine.device("58xx"); | |
240 | device_t *io56xx = machine.device("56xx"); | |
239 | device_t *io58xx = machine().device("58xx"); | |
240 | device_t *io56xx = machine().device("56xx"); | |
241 | 241 | |
242 | 242 | switch (param) |
243 | 243 | { |
r18112 | r18113 | |
260 | 260 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
261 | 261 | |
262 | 262 | if (!namcoio_read_reset_line(io58xx)) /* give the cpu a tiny bit of time to write the command before processing it */ |
263 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run)); | |
263 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(gaplus_state::namcoio_run),this)); | |
264 | 264 | |
265 | 265 | if (!namcoio_read_reset_line(io56xx)) /* give the cpu a tiny bit of time to write the command before processing it */ |
266 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run), 1); | |
266 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(gaplus_state::namcoio_run),this), 1); | |
267 | 267 | } |
268 | 268 | |
269 | 269 | INTERRUPT_GEN_MEMBER(gaplus_state::gaplus_vblank_sub_irq) |
r18112 | r18113 | |
---|---|---|
97 | 97 | * |
98 | 98 | *************************************/ |
99 | 99 | |
100 | ||
100 | TIMER_CALLBACK_MEMBER(gridlee_state::irq_off_tick) | |
101 | 101 | { |
102 | machine.device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, CLEAR_LINE); | |
102 | machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, CLEAR_LINE); | |
103 | 103 | } |
104 | 104 | |
105 | 105 | |
106 | ||
106 | TIMER_CALLBACK_MEMBER(gridlee_state::irq_timer_tick) | |
107 | 107 | { |
108 | gridlee_state *state = machine.driver_data<gridlee_state>(); | |
109 | 108 | /* next interrupt after scanline 256 is scanline 64 */ |
110 | 109 | if (param == 256) |
111 | | |
110 | m_irq_timer->adjust(machine().primary_screen->time_until_pos(64), 64); | |
112 | 111 | else |
113 | | |
112 | m_irq_timer->adjust(machine().primary_screen->time_until_pos(param + 64), param + 64); | |
114 | 113 | |
115 | 114 | /* IRQ starts on scanline 0, 64, 128, etc. */ |
116 | machine.device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE); | |
115 | machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE); | |
117 | 116 | |
118 | 117 | /* it will turn off on the next HBLANK */ |
119 | | |
118 | m_irq_off->adjust(machine().primary_screen->time_until_pos(param, GRIDLEE_HBSTART)); | |
120 | 119 | } |
121 | 120 | |
122 | 121 | |
123 | ||
122 | TIMER_CALLBACK_MEMBER(gridlee_state::firq_off_tick) | |
124 | 123 | { |
125 | machine.device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, CLEAR_LINE); | |
124 | machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, CLEAR_LINE); | |
126 | 125 | } |
127 | 126 | |
128 | 127 | |
129 | ||
128 | TIMER_CALLBACK_MEMBER(gridlee_state::firq_timer_tick) | |
130 | 129 | { |
131 | gridlee_state *state = machine.driver_data<gridlee_state>(); | |
132 | 130 | /* same time next frame */ |
133 | | |
131 | m_firq_timer->adjust(machine().primary_screen->time_until_pos(FIRQ_SCANLINE)); | |
134 | 132 | |
135 | 133 | /* IRQ starts on scanline FIRQ_SCANLINE? */ |
136 | machine.device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); | |
134 | machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); | |
137 | 135 | |
138 | 136 | /* it will turn off on the next HBLANK */ |
139 | | |
137 | m_firq_off->adjust(machine().primary_screen->time_until_pos(FIRQ_SCANLINE, GRIDLEE_HBSTART)); | |
140 | 138 | } |
141 | 139 | |
142 | 140 | void gridlee_state::machine_start() |
r18112 | r18113 | |
149 | 147 | state_save_register_global_array(machine(), m_last_analog_input); |
150 | 148 | state_save_register_global_array(machine(), m_last_analog_output); |
151 | 149 | |
152 | m_irq_off = machine().scheduler().timer_alloc(FUNC(irq_off_tick)); | |
153 | m_irq_timer = machine().scheduler().timer_alloc(FUNC(irq_timer_tick)); | |
154 | m_firq_off = machine().scheduler().timer_alloc(FUNC(firq_off_tick)); | |
155 | m_firq_timer = machine().scheduler().timer_alloc(FUNC(firq_timer_tick)); | |
150 | m_irq_off = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gridlee_state::irq_off_tick),this)); | |
151 | m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gridlee_state::irq_timer_tick),this)); | |
152 | m_firq_off = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gridlee_state::firq_off_tick),this)); | |
153 | m_firq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gridlee_state::firq_timer_tick),this)); | |
156 | 154 | } |
157 | 155 | |
158 | 156 |
r18112 | r18113 | |
---|---|---|
133 | 133 | * |
134 | 134 | *************************************/ |
135 | 135 | |
136 | ||
136 | TIMER_CALLBACK_MEMBER(artmagic_state::irq_off) | |
137 | 137 | { |
138 | artmagic_state *state = machine.driver_data<artmagic_state>(); | |
139 | state->m_hack_irq = 0; | |
140 | update_irq_state(machine); | |
138 | m_hack_irq = 0; | |
139 | update_irq_state(machine()); | |
141 | 140 | } |
142 | 141 | |
143 | 142 | READ16_MEMBER(artmagic_state::ultennis_hack_r) |
r18112 | r18113 | |
148 | 147 | { |
149 | 148 | m_hack_irq = 1; |
150 | 149 | update_irq_state(machine()); |
151 | machine().scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off)); | |
150 | machine().scheduler().timer_set(attotime::from_usec(1), timer_expired_delegate(FUNC(artmagic_state::irq_off),this)); | |
152 | 151 | } |
153 | 152 | return ioport("300000")->read(); |
154 | 153 | } |
r18112 | r18113 | |
---|---|---|
118 | 118 | if (num_inactive) do { *dst = 0; dst += 8; } while (--num_inactive); |
119 | 119 | } |
120 | 120 | |
121 | ||
121 | TIMER_CALLBACK_MEMBER(moo_state::dmaend_callback) | |
122 | 122 | { |
123 | moo_state *state = machine.driver_data<moo_state>(); | |
124 | if (state->m_cur_control2 & 0x800) | |
125 | state->m_maincpu->set_input_line(4, HOLD_LINE); | |
123 | if (m_cur_control2 & 0x800) | |
124 | m_maincpu->set_input_line(4, HOLD_LINE); | |
126 | 125 | } |
127 | 126 | |
128 | 127 | INTERRUPT_GEN_MEMBER(moo_state::moo_interrupt) |
r18112 | r18113 | |
439 | 438 | save_item(NAME(m_layerpri)); |
440 | 439 | save_item(NAME(m_protram)); |
441 | 440 | |
442 | m_dmaend_timer = machine().scheduler().timer_alloc(FUNC(dmaend_callback)); | |
441 | m_dmaend_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(moo_state::dmaend_callback),this)); | |
443 | 442 | } |
444 | 443 | |
445 | 444 | MACHINE_RESET_MEMBER(moo_state,moo) |
r18112 | r18113 | |
---|---|---|
315 | 315 | } |
316 | 316 | #endif |
317 | 317 | |
318 | ||
318 | TIMER_CALLBACK_MEMBER(tmnt_state::nmi_callback) | |
319 | 319 | { |
320 | tmnt_state *state = machine.driver_data<tmnt_state>(); | |
321 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
320 | m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
322 | 321 | } |
323 | 322 | |
324 | 323 | WRITE8_MEMBER(tmnt_state::sound_arm_nmi_w) |
325 | 324 | { |
326 | 325 | // sound_nmi_enabled = 1; |
327 | 326 | m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); |
328 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(nmi_callback)); /* kludge until the K053260 is emulated correctly */ | |
327 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(tmnt_state::nmi_callback),this)); /* kludge until the K053260 is emulated correctly */ | |
329 | 328 | } |
330 | 329 | |
331 | 330 |
r18112 | r18113 | |
---|---|---|
454 | 454 | * |
455 | 455 | *************************************/ |
456 | 456 | |
457 | ||
457 | TIMER_CALLBACK_MEMBER(coolpool_state::deferred_iop_w) | |
458 | 458 | { |
459 | coolpool_state *state = machine.driver_data<coolpool_state>(); | |
460 | 459 | |
461 | state->m_iop_cmd = param; | |
462 | state->m_cmd_pending = 1; | |
463 | machine.device("dsp")->execute().set_input_line(0, HOLD_LINE); /* ??? I have no idea who should generate this! */ | |
460 | m_iop_cmd = param; | |
461 | m_cmd_pending = 1; | |
462 | machine().device("dsp")->execute().set_input_line(0, HOLD_LINE); /* ??? I have no idea who should generate this! */ | |
464 | 463 | /* the DSP polls the status bit so it isn't strictly */ |
465 | 464 | /* necessary to also have an IRQ */ |
466 | machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); | |
465 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); | |
467 | 466 | } |
468 | 467 | |
469 | 468 | |
470 | 469 | WRITE16_MEMBER(coolpool_state::coolpool_iop_w) |
471 | 470 | { |
472 | 471 | logerror("%08x:IOP write %04x\n", space.device().safe_pc(), data); |
473 | machine().scheduler().synchronize(FUNC(deferred_iop_w), data); | |
472 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(coolpool_state::deferred_iop_w),this), data); | |
474 | 473 | } |
475 | 474 | |
476 | 475 |
r18112 | r18113 | |
---|---|---|
747 | 747 | |
748 | 748 | /* different games need different interrupt generators & timers because they use different Namco I/O devices */ |
749 | 749 | |
750 | ||
750 | TIMER_CALLBACK_MEMBER(mappy_state::superpac_io_run) | |
751 | 751 | { |
752 | device_t *io56xx_1 = machine.device("namcoio_1"); | |
753 | device_t *io56xx_2 = machine.device("namcoio_2"); | |
752 | device_t *io56xx_1 = machine().device("namcoio_1"); | |
753 | device_t *io56xx_2 = machine().device("namcoio_2"); | |
754 | 754 | |
755 | 755 | switch (param) |
756 | 756 | { |
r18112 | r18113 | |
772 | 772 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
773 | 773 | |
774 | 774 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
775 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(superpac_io_run)); | |
775 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::superpac_io_run),this)); | |
776 | 776 | |
777 | 777 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
778 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(superpac_io_run), 1); | |
778 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::superpac_io_run),this), 1); | |
779 | 779 | } |
780 | 780 | |
781 | ||
781 | TIMER_CALLBACK_MEMBER(mappy_state::pacnpal_io_run) | |
782 | 782 | { |
783 | device_t *io56xx = machine.device("namcoio_1"); | |
784 | device_t *io59xx = machine.device("namcoio_2"); | |
783 | device_t *io56xx = machine().device("namcoio_1"); | |
784 | device_t *io59xx = machine().device("namcoio_2"); | |
785 | 785 | |
786 | 786 | switch (param) |
787 | 787 | { |
r18112 | r18113 | |
803 | 803 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
804 | 804 | |
805 | 805 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
806 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(pacnpal_io_run)); | |
806 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::pacnpal_io_run),this)); | |
807 | 807 | |
808 | 808 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
809 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(pacnpal_io_run), 1); | |
809 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::pacnpal_io_run),this), 1); | |
810 | 810 | } |
811 | 811 | |
812 | ||
812 | TIMER_CALLBACK_MEMBER(mappy_state::phozon_io_run) | |
813 | 813 | { |
814 | device_t *io58xx = machine.device("namcoio_1"); | |
815 | device_t *io56xx = machine.device("namcoio_2"); | |
814 | device_t *io58xx = machine().device("namcoio_1"); | |
815 | device_t *io56xx = machine().device("namcoio_2"); | |
816 | 816 | |
817 | 817 | switch (param) |
818 | 818 | { |
r18112 | r18113 | |
834 | 834 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
835 | 835 | |
836 | 836 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
837 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(phozon_io_run)); | |
837 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::phozon_io_run),this)); | |
838 | 838 | |
839 | 839 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
840 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(phozon_io_run), 1); | |
840 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::phozon_io_run),this), 1); | |
841 | 841 | } |
842 | 842 | |
843 | ||
843 | TIMER_CALLBACK_MEMBER(mappy_state::mappy_io_run) | |
844 | 844 | { |
845 | device_t *io58xx_1 = machine.device("namcoio_1"); | |
846 | device_t *io58xx_2 = machine.device("namcoio_2"); | |
845 | device_t *io58xx_1 = machine().device("namcoio_1"); | |
846 | device_t *io58xx_2 = machine().device("namcoio_2"); | |
847 | 847 | |
848 | 848 | switch (param) |
849 | 849 | { |
r18112 | r18113 | |
865 | 865 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); |
866 | 866 | |
867 | 867 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
868 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(mappy_io_run)); | |
868 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::mappy_io_run),this)); | |
869 | 869 | |
870 | 870 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
871 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(mappy_io_run), 1); | |
871 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(mappy_state::mappy_io_run),this), 1); | |
872 | 872 | } |
873 | 873 | |
874 | 874 | INTERRUPT_GEN_MEMBER(mappy_state::sub_vblank_irq) |
r18112 | r18113 | |
---|---|---|
225 | 225 | INTERRUPTS |
226 | 226 | ***********************************************************/ |
227 | 227 | |
228 | ||
228 | TIMER_CALLBACK_MEMBER(undrfire_state::interrupt5) | |
229 | 229 | { |
230 | machine.device("maincpu")->execute().set_input_line(5, HOLD_LINE); | |
230 | machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE); | |
231 | 231 | } |
232 | 232 | |
233 | 233 | |
r18112 | r18113 | |
359 | 359 | WRITE32_MEMBER(undrfire_state::unknown_int_req_w) |
360 | 360 | { |
361 | 361 | /* 10000 cycle delay is arbitrary */ |
362 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), FUNC(interrupt5)); | |
362 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), timer_expired_delegate(FUNC(undrfire_state::interrupt5),this)); | |
363 | 363 | } |
364 | 364 | |
365 | 365 | |
r18112 | r18113 | |
464 | 464 | { |
465 | 465 | /* One interrupt per input port (4 per frame, though only 2 used). |
466 | 466 | 1000 cycle delay is arbitrary */ |
467 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), FUNC(interrupt5)); | |
467 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), timer_expired_delegate(FUNC(undrfire_state::interrupt5),this)); | |
468 | 468 | } |
469 | 469 | |
470 | 470 | /*********************************************************** |
r18112 | r18113 | |
---|---|---|
254 | 254 | ADDRESS_MAP_END |
255 | 255 | |
256 | 256 | |
257 | ||
257 | TIMER_CALLBACK_MEMBER(tubep_state::tubep_scanline_callback) | |
258 | 258 | { |
259 | tubep_state *state = machine.driver_data<tubep_state>(); | |
260 | 259 | int scanline = param; |
261 | 260 | |
262 | | |
261 | m_curr_scanline = scanline;//for debugging | |
263 | 262 | |
264 | 263 | /* CPU #0 interrupt */ |
265 | 264 | /* activates at the start of VBLANK signal which happens at the beginning of scaline number 240 */ |
266 | 265 | if (scanline == 240) |
267 | 266 | { |
268 | 267 | logerror("VBLANK CPU#0\n"); |
269 | machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
268 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
270 | 269 | } |
271 | 270 | |
272 | 271 | |
r18112 | r18113 | |
275 | 274 | if (scanline == 16) |
276 | 275 | { |
277 | 276 | logerror("/VBLANK CPU#1\n"); |
278 | machine.device("slave")->execute().set_input_line(0, ASSERT_LINE); | |
277 | machine().device("slave")->execute().set_input_line(0, ASSERT_LINE); | |
279 | 278 | } |
280 | 279 | |
281 | 280 | |
r18112 | r18113 | |
284 | 283 | if (scanline == 16) |
285 | 284 | { |
286 | 285 | logerror("/nmi CPU#3\n"); |
287 | tubep_vblank_end(machine); /* switch buffered sprite RAM page */ | |
288 | machine.device("mcu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
286 | tubep_vblank_end(machine()); /* switch buffered sprite RAM page */ | |
287 | machine().device("mcu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
289 | 288 | } |
290 | 289 | /* CPU #3 MS2010-A NMI */ |
291 | 290 | /* deactivates at the start of VBLANK signal which happens at the beginning of scanline number 240*/ |
292 | 291 | if (scanline == 240) |
293 | 292 | { |
294 | 293 | logerror("CPU#3 nmi clear\n"); |
295 | machine.device("mcu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); | |
294 | machine().device("mcu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); | |
296 | 295 | } |
297 | 296 | |
298 | 297 | |
r18112 | r18113 | |
300 | 299 | /* activates whenever line V6 from video part goes lo->hi that is when the scanline becomes 64 and 192 */ |
301 | 300 | if ((scanline == 64) || (scanline == 192)) |
302 | 301 | { |
303 | machine.device("soundcpu")->execute().set_input_line(0, ASSERT_LINE); /* sound cpu interrupt (music tempo) */ | |
302 | machine().device("soundcpu")->execute().set_input_line(0, ASSERT_LINE); /* sound cpu interrupt (music tempo) */ | |
304 | 303 | } |
305 | 304 | |
306 | 305 | |
307 | machine.primary_screen->update_partial(machine.primary_screen->vpos()); | |
306 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); | |
308 | 307 | |
309 | 308 | //debug |
310 | logerror("scanline=%3i scrgetvpos(0)=%3i\n",scanline,machine.primary_screen->vpos()); | |
309 | logerror("scanline=%3i scrgetvpos(0)=%3i\n",scanline,machine().primary_screen->vpos()); | |
311 | 310 | |
312 | 311 | scanline++; |
313 | 312 | if (scanline >= 264) |
314 | 313 | scanline = 0; |
315 | 314 | |
316 | | |
315 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
317 | 316 | } |
318 | 317 | |
319 | 318 | |
r18112 | r18113 | |
338 | 337 | MACHINE_START_MEMBER(tubep_state,tubep) |
339 | 338 | { |
340 | 339 | /* Create interrupt timer */ |
341 | m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(tubep_scanline_callback)); | |
340 | m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tubep_state::tubep_scanline_callback),this)); | |
342 | 341 | |
343 | 342 | tubep_setup_save_state(machine()); |
344 | 343 | } |
r18112 | r18113 | |
437 | 436 | ADDRESS_MAP_END |
438 | 437 | |
439 | 438 | |
440 | ||
439 | TIMER_CALLBACK_MEMBER(tubep_state::rjammer_scanline_callback) | |
441 | 440 | { |
442 | tubep_state *state = machine.driver_data<tubep_state>(); | |
443 | 441 | int scanline = param; |
444 | 442 | |
445 | | |
443 | m_curr_scanline = scanline;//for debugging | |
446 | 444 | |
447 | 445 | /* CPU #0 interrupt */ |
448 | 446 | /* activates at the start of VBLANK signal which happens at the beginning of scaline number 240 */ |
449 | 447 | if (scanline == 240) |
450 | 448 | { |
451 | 449 | logerror("VBLANK CPU#0\n"); |
452 | machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
450 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
453 | 451 | } |
454 | 452 | |
455 | 453 | |
r18112 | r18113 | |
458 | 456 | if (scanline == 16) |
459 | 457 | { |
460 | 458 | logerror("/VBLANK CPU#1\n"); |
461 | machine.device("slave")->execute().set_input_line(0, HOLD_LINE); | |
459 | machine().device("slave")->execute().set_input_line(0, HOLD_LINE); | |
462 | 460 | } |
463 | 461 | |
464 | 462 | |
r18112 | r18113 | |
467 | 465 | if (scanline == 16) |
468 | 466 | { |
469 | 467 | logerror("/nmi CPU#3\n"); |
470 | tubep_vblank_end(machine); /* switch buffered sprite RAM page */ | |
471 | machine.device("mcu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
468 | tubep_vblank_end(machine()); /* switch buffered sprite RAM page */ | |
469 | machine().device("mcu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
472 | 470 | } |
473 | 471 | /* CPU #3 MS2010-A NMI */ |
474 | 472 | /* deactivates at the start of VBLANK signal which happens at the beginning of scanline number 240*/ |
475 | 473 | if (scanline == 240) |
476 | 474 | { |
477 | 475 | logerror("CPU#3 nmi clear\n"); |
478 | machine.device("mcu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); | |
476 | machine().device("mcu")->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE); | |
479 | 477 | } |
480 | 478 | |
481 | 479 | |
r18112 | r18113 | |
483 | 481 | /* activates whenever line V6 from video part goes lo->hi that is when the scanline becomes 64 and 192 */ |
484 | 482 | if ((scanline == 64) || (scanline == 192)) |
485 | 483 | { |
486 | machine.device("soundcpu")->execute().set_input_line(0, ASSERT_LINE); /* sound cpu interrupt (music tempo) */ | |
484 | machine().device("soundcpu")->execute().set_input_line(0, ASSERT_LINE); /* sound cpu interrupt (music tempo) */ | |
487 | 485 | } |
488 | 486 | |
489 | 487 | |
490 | machine.primary_screen->update_partial(machine.primary_screen->vpos()); | |
488 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); | |
491 | 489 | |
492 | logerror("scanline=%3i scrgetvpos(0)=%3i\n", scanline, machine.primary_screen->vpos()); | |
490 | logerror("scanline=%3i scrgetvpos(0)=%3i\n", scanline, machine().primary_screen->vpos()); | |
493 | 491 | |
494 | 492 | scanline++; |
495 | 493 | if (scanline >= 264) |
496 | 494 | scanline = 0; |
497 | 495 | |
498 | | |
496 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
499 | 497 | } |
500 | 498 | |
501 | 499 | |
502 | 500 | MACHINE_START_MEMBER(tubep_state,rjammer) |
503 | 501 | { |
504 | 502 | /* Create interrupt timer */ |
505 | m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(rjammer_scanline_callback)); | |
503 | m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tubep_state::rjammer_scanline_callback),this)); | |
506 | 504 | |
507 | 505 | tubep_setup_save_state(machine()); |
508 | 506 | } |
r18112 | r18113 | |
---|---|---|
17 | 17 | #include "includes/runaway.h" |
18 | 18 | |
19 | 19 | |
20 | ||
20 | TIMER_CALLBACK_MEMBER(runaway_state::interrupt_callback) | |
21 | 21 | { |
22 | runaway_state *state = machine.driver_data<runaway_state>(); | |
23 | 22 | /* assume Centipede-style interrupt timing */ |
24 | 23 | int scanline = param; |
25 | 24 | |
26 | machine.device("maincpu")->execute().set_input_line(0, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE); | |
25 | machine().device("maincpu")->execute().set_input_line(0, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE); | |
27 | 26 | |
28 | 27 | scanline += 32; |
29 | 28 | |
30 | 29 | if (scanline >= 263) |
31 | 30 | scanline = 16; |
32 | 31 | |
33 | | |
32 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
34 | 33 | } |
35 | 34 | |
36 | 35 | void runaway_state::machine_start() |
37 | 36 | { |
38 | m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(interrupt_callback)); | |
37 | m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(runaway_state::interrupt_callback),this)); | |
39 | 38 | } |
40 | 39 | |
41 | 40 | void runaway_state::machine_reset() |
r18112 | r18113 | |
---|---|---|
562 | 562 | } |
563 | 563 | |
564 | 564 | |
565 | ||
565 | TIMER_CALLBACK_MEMBER(segas32_state::end_of_vblank_int) | |
566 | 566 | { |
567 | signal_v60_irq(machine, MAIN_IRQ_VBSTOP); | |
568 | system32_set_vblank(machine, 0); | |
567 | signal_v60_irq(machine(), MAIN_IRQ_VBSTOP); | |
568 | system32_set_vblank(machine(), 0); | |
569 | 569 | } |
570 | 570 | |
571 | 571 | |
r18112 | r18113 | |
573 | 573 | { |
574 | 574 | signal_v60_irq(machine(), MAIN_IRQ_VBSTART); |
575 | 575 | system32_set_vblank(machine(), 1); |
576 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), FUNC(end_of_vblank_int)); | |
576 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(segas32_state::end_of_vblank_int),this)); | |
577 | 577 | if (m_system32_prot_vblank) |
578 | 578 | (*m_system32_prot_vblank)(&device); |
579 | 579 | } |
r18112 | r18113 | |
---|---|---|
120 | 120 | } |
121 | 121 | #endif |
122 | 122 | |
123 | ||
123 | TIMER_CALLBACK_MEMBER(simpsons_state::nmi_callback) | |
124 | 124 | { |
125 | simpsons_state *state = machine.driver_data<simpsons_state>(); | |
126 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
125 | m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
127 | 126 | } |
128 | 127 | |
129 | 128 | WRITE8_MEMBER(simpsons_state::z80_arm_nmi_w) |
130 | 129 | { |
131 | 130 | m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); |
132 | machine().scheduler().timer_set(attotime::from_usec(25), FUNC(nmi_callback)); /* kludge until the K053260 is emulated correctly */ | |
131 | machine().scheduler().timer_set(attotime::from_usec(25), timer_expired_delegate(FUNC(simpsons_state::nmi_callback),this)); /* kludge until the K053260 is emulated correctly */ | |
133 | 132 | } |
134 | 133 | |
135 | 134 | static ADDRESS_MAP_START( z80_map, AS_PROGRAM, 8, simpsons_state ) |
r18112 | r18113 | |
252 | 251 | if (num_inactive) do { *dst = 0; dst += 8; } while (--num_inactive); |
253 | 252 | } |
254 | 253 | |
255 | ||
254 | TIMER_CALLBACK_MEMBER(simpsons_state::dmaend_callback) | |
256 | 255 | { |
257 | simpsons_state *state = machine.driver_data<simpsons_state>(); | |
258 | if (state->m_firq_enabled) | |
259 | state->m_maincpu->set_input_line(KONAMI_FIRQ_LINE, HOLD_LINE); | |
256 | if (m_firq_enabled) | |
257 | m_maincpu->set_input_line(KONAMI_FIRQ_LINE, HOLD_LINE); | |
260 | 258 | } |
261 | 259 | |
262 | 260 | |
r18112 | r18113 | |
267 | 265 | { |
268 | 266 | simpsons_objdma(machine()); |
269 | 267 | // 32+256us delay at 8MHz dotclock; artificially shortened since actual V-blank length is unknown |
270 | machine().scheduler().timer_set(attotime::from_usec(30), FUNC(dmaend_callback)); | |
268 | machine().scheduler().timer_set(attotime::from_usec(30), timer_expired_delegate(FUNC(simpsons_state::dmaend_callback),this)); | |
271 | 269 | } |
272 | 270 | |
273 | 271 | if (k052109_is_irq_enabled(m_k052109)) |
r18112 | r18113 | |
---|---|---|
53 | 53 | state->m_maincpu->set_input_line(3, (irq & state->m_int_num) ? ASSERT_LINE : CLEAR_LINE); |
54 | 54 | } |
55 | 55 | |
56 | ||
56 | TIMER_CALLBACK_MEMBER(hyprduel_state::vblank_end_callback) | |
57 | 57 | { |
58 | hyprduel_state *state = machine.driver_data<hyprduel_state>(); | |
59 | state->m_requested_int &= ~param; | |
58 | m_requested_int &= ~param; | |
60 | 59 | } |
61 | 60 | |
62 | 61 | static TIMER_DEVICE_CALLBACK( hyprduel_interrupt ) |
r18112 | r18113 | |
70 | 69 | state->m_requested_int |= 0x20; |
71 | 70 | state->m_maincpu->set_input_line(2, HOLD_LINE); |
72 | 71 | /* the duration is a guess */ |
73 | timer.machine().scheduler().timer_set(attotime::from_usec(2500), FUNC(vblank_end_callback), 0x20); | |
72 | timer.machine().scheduler().timer_set(attotime::from_usec(2500), timer_expired_delegate(FUNC(hyprduel_state::vblank_end_callback),state), 0x20); | |
74 | 73 | } |
75 | 74 | else |
76 | 75 | state->m_requested_int |= 0x12; /* hsync */ |
r18112 | r18113 | |
181 | 180 | } |
182 | 181 | |
183 | 182 | |
184 | ||
183 | TIMER_CALLBACK_MEMBER(hyprduel_state::magerror_irq_callback) | |
185 | 184 | { |
186 | hyprduel_state *state = machine.driver_data<hyprduel_state>(); | |
187 | state->m_subcpu->set_input_line(1, HOLD_LINE); | |
185 | m_subcpu->set_input_line(1, HOLD_LINE); | |
188 | 186 | } |
189 | 187 | |
190 | 188 | /*************************************************************************** |
r18112 | r18113 | |
256 | 254 | |
257 | 255 | ***************************************************************************/ |
258 | 256 | |
259 | ||
257 | TIMER_CALLBACK_MEMBER(hyprduel_state::hyprduel_blit_done) | |
260 | 258 | { |
261 | hyprduel_state *state = machine.driver_data<hyprduel_state>(); | |
262 | state->m_requested_int |= 1 << state->m_blitter_bit; | |
263 | update_irq_state(machine); | |
259 | m_requested_int |= 1 << m_blitter_bit; | |
260 | update_irq_state(machine()); | |
264 | 261 | } |
265 | 262 | |
266 | 263 | INLINE int blt_read( const UINT8 *ROM, const int offs ) |
r18112 | r18113 | |
332 | 329 | another blit. */ |
333 | 330 | if (b1 == 0) |
334 | 331 | { |
335 | machine().scheduler().timer_set(attotime::from_usec(500), FUNC(hyprduel_blit_done)); | |
332 | machine().scheduler().timer_set(attotime::from_usec(500), timer_expired_delegate(FUNC(hyprduel_state::hyprduel_blit_done),this)); | |
336 | 333 | return; |
337 | 334 | } |
338 | 335 | |
r18112 | r18113 | |
813 | 810 | { |
814 | 811 | |
815 | 812 | m_int_num = 0x01; |
816 | m_magerror_irq_timer = machine().scheduler().timer_alloc(FUNC(magerror_irq_callback)); | |
813 | m_magerror_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hyprduel_state::magerror_irq_callback),this)); | |
817 | 814 | } |
818 | 815 | |
819 | 816 |
r18112 | r18113 | |
---|---|---|
230 | 230 | INTERRUPTS |
231 | 231 | ***********************************************************/ |
232 | 232 | |
233 | ||
233 | TIMER_CALLBACK_MEMBER(asuka_state::cadash_interrupt5) | |
234 | 234 | { |
235 | asuka_state *state = machine.driver_data<asuka_state>(); | |
236 | state->m_maincpu->set_input_line(5, HOLD_LINE); | |
235 | m_maincpu->set_input_line(5, HOLD_LINE); | |
237 | 236 | } |
238 | 237 | |
239 | 238 | INTERRUPT_GEN_MEMBER(asuka_state::cadash_interrupt) |
240 | 239 | { |
241 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(500), FUNC(cadash_interrupt5)); | |
240 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(500), timer_expired_delegate(FUNC(asuka_state::cadash_interrupt5),this)); | |
242 | 241 | device.execute().set_input_line(4, HOLD_LINE); /* interrupt vector 4 */ |
243 | 242 | } |
244 | 243 |
r18112 | r18113 | |
---|---|---|
69 | 69 | return k053260_r(device, space, 2 + offset); |
70 | 70 | } |
71 | 71 | |
72 | ||
72 | TIMER_CALLBACK_MEMBER(asterix_state::nmi_callback) | |
73 | 73 | { |
74 | asterix_state *state = machine.driver_data<asterix_state>(); | |
75 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
74 | m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
76 | 75 | } |
77 | 76 | |
78 | 77 | WRITE8_MEMBER(asterix_state::sound_arm_nmi_w) |
79 | 78 | { |
80 | 79 | |
81 | 80 | m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); |
82 | machine().scheduler().timer_set(attotime::from_usec(5), FUNC(nmi_callback)); | |
81 | machine().scheduler().timer_set(attotime::from_usec(5), timer_expired_delegate(FUNC(asterix_state::nmi_callback),this)); | |
83 | 82 | } |
84 | 83 | |
85 | 84 | WRITE16_MEMBER(asterix_state::sound_irq_w) |
r18112 | r18113 | |
---|---|---|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
72 | ||
72 | TIMER_CALLBACK_MEMBER(fgoal_state::interrupt_callback) | |
73 | 73 | { |
74 | fgoal_state *state = machine.driver_data<fgoal_state>(); | |
75 | 74 | int scanline; |
76 | int coin = ( | |
75 | int coin = (ioport("IN1")->read() & 2); | |
77 | 76 | |
78 | | |
77 | m_maincpu->set_input_line(0, ASSERT_LINE); | |
79 | 78 | |
80 | if (!coin && state->m_prev_coin) | |
81 | state->m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
79 | if (!coin && m_prev_coin) | |
80 | m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
82 | 81 | |
83 | | |
82 | m_prev_coin = coin; | |
84 | 83 | |
85 | scanline = machine.primary_screen->vpos() + 128; | |
84 | scanline = machine().primary_screen->vpos() + 128; | |
86 | 85 | |
87 | 86 | if (scanline > 256) |
88 | 87 | scanline = 0; |
89 | 88 | |
90 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(interrupt_callback)); | |
89 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(fgoal_state::interrupt_callback),this)); | |
91 | 90 | } |
92 | 91 | |
93 | 92 | |
r18112 | r18113 | |
346 | 345 | void fgoal_state::machine_reset() |
347 | 346 | { |
348 | 347 | |
349 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), FUNC(interrupt_callback)); | |
348 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(fgoal_state::interrupt_callback),this)); | |
350 | 349 | |
351 | 350 | m_xpos = 0; |
352 | 351 | m_ypos = 0; |
r18112 | r18113 | |
---|---|---|
113 | 113 | * |
114 | 114 | *************************************/ |
115 | 115 | |
116 | ||
116 | TIMER_CALLBACK_MEMBER(suprridr_state::delayed_sound_w) | |
117 | 117 | { |
118 | suprridr_state *state = machine.driver_data<suprridr_state>(); | |
119 | state->m_sound_data = param; | |
120 | machine.device("audiocpu")->execute().set_input_line(0, ASSERT_LINE); | |
118 | m_sound_data = param; | |
119 | machine().device("audiocpu")->execute().set_input_line(0, ASSERT_LINE); | |
121 | 120 | } |
122 | 121 | |
123 | 122 | |
124 | 123 | WRITE8_MEMBER(suprridr_state::sound_data_w) |
125 | 124 | { |
126 | machine().scheduler().synchronize(FUNC(delayed_sound_w), data); | |
125 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(suprridr_state::delayed_sound_w),this), data); | |
127 | 126 | } |
128 | 127 | |
129 | 128 |
r18112 | r18113 | |
---|---|---|
213 | 213 | |
214 | 214 | |
215 | 215 | |
216 | ||
216 | TIMER_CALLBACK_MEMBER(sslam_state::music_playback) | |
217 | 217 | { |
218 | sslam_state *state = machine.driver_data<sslam_state>(); | |
219 | 218 | int pattern = 0; |
220 | okim6295_device *device = machine.device<okim6295_device>("oki"); | |
219 | okim6295_device *device = machine().device<okim6295_device>("oki"); | |
221 | 220 | |
222 | 221 | if ((device->read_status() & 0x08) == 0) |
223 | 222 | { |
224 | state->m_bar += 1; | |
225 | pattern = sslam_snd_loop[state->m_melody][state->m_bar]; | |
223 | m_bar += 1; | |
224 | pattern = sslam_snd_loop[m_melody][m_bar]; | |
226 | 225 | |
227 | 226 | if (pattern) { |
228 | 227 | if (pattern == 0xff) { /* Repeat track from first bar */ |
229 | state->m_bar = 0; | |
230 | pattern = sslam_snd_loop[state->m_melody][state->m_bar]; | |
228 | m_bar = 0; | |
229 | pattern = sslam_snd_loop[m_melody][m_bar]; | |
231 | 230 | } |
232 | 231 | logerror("Changing bar in music track to pattern %02x\n",pattern); |
233 | 232 | device->write_command(0x80 | pattern); |
234 | 233 | device->write_command(0x81); |
235 | 234 | } |
236 | 235 | else if (pattern == 0x00) { /* Non-looped track. Stop playing it */ |
237 | state->m_track = 0; | |
238 | state->m_melody = 0; | |
239 | state->m_bar = 0; | |
240 | state->m_music_timer->enable(false); | |
236 | m_track = 0; | |
237 | m_melody = 0; | |
238 | m_bar = 0; | |
239 | m_music_timer->enable(false); | |
241 | 240 | } |
242 | 241 | } |
243 | 242 | |
244 | 243 | if (0) |
245 | 244 | { |
246 | pattern = sslam_snd_loop[state->m_melody][state->m_bar]; | |
247 | popmessage("Music track: %02x, Melody: %02x, Pattern: %02x, Bar:%02d",state->m_track,state->m_melody,pattern,state->m_bar); | |
245 | pattern = sslam_snd_loop[m_melody][m_bar]; | |
246 | popmessage("Music track: %02x, Melody: %02x, Pattern: %02x, Bar:%02d",m_track,m_melody,pattern,m_bar); | |
248 | 247 | } |
249 | 248 | } |
250 | 249 | |
r18112 | r18113 | |
926 | 925 | save_item(NAME(m_bar)); |
927 | 926 | save_item(NAME(m_snd_bank)); |
928 | 927 | |
929 | m_music_timer = machine().scheduler().timer_alloc(FUNC(music_playback)); | |
928 | m_music_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(sslam_state::music_playback),this)); | |
930 | 929 | } |
931 | 930 | |
932 | 931 | DRIVER_INIT_MEMBER(sslam_state,powerbls) |
r18112 | r18113 | |
---|---|---|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | ||
43 | TIMER_CALLBACK_MEMBER(skullxbo_state::irq_gen) | |
44 | 44 | { |
45 | atarigen_scanline_int_gen(machine.device("maincpu")); | |
45 | atarigen_scanline_int_gen(machine().device("maincpu")); | |
46 | 46 | } |
47 | 47 | |
48 | 48 | |
r18112 | r18113 | |
57 | 57 | { |
58 | 58 | int width = screen.width(); |
59 | 59 | attotime period = screen.time_until_pos(screen.vpos() + 6, width * 0.9); |
60 | screen.machine().scheduler().timer_set(period, FUNC(irq_gen)); | |
60 | screen.machine().scheduler().timer_set(period, timer_expired_delegate(FUNC(skullxbo_state::irq_gen),state)); | |
61 | 61 | } |
62 | 62 | |
63 | 63 | /* update the playfield and motion objects */ |
r18112 | r18113 | |
---|---|---|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | ||
43 | TIMER_CALLBACK_MEMBER(orbit_state::irq_off) | |
44 | 44 | { |
45 | orbit_state *state = machine.driver_data<orbit_state>(); | |
46 | state->m_maincpu->set_input_line(0, CLEAR_LINE); | |
45 | m_maincpu->set_input_line(0, CLEAR_LINE); | |
47 | 46 | } |
48 | 47 | |
49 | 48 | |
50 | 49 | INTERRUPT_GEN_MEMBER(orbit_state::orbit_interrupt) |
51 | 50 | { |
52 | 51 | device.execute().set_input_line(0, ASSERT_LINE); |
53 | machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_end(), FUNC(irq_off)); | |
52 | machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_end(), timer_expired_delegate(FUNC(orbit_state::irq_off),this)); | |
54 | 53 | } |
55 | 54 | |
56 | 55 |
r18112 | r18113 | |
---|---|---|
24 | 24 | |
25 | 25 | //port A of ay8910#0 |
26 | 26 | |
27 | ||
27 | TIMER_CALLBACK_MEMBER(tankbust_state::soundlatch_callback) | |
28 | 28 | { |
29 | tankbust_state *state = machine.driver_data<tankbust_state>(); | |
30 | state->m_latch = param; | |
29 | m_latch = param; | |
31 | 30 | } |
32 | 31 | |
33 | 32 | WRITE8_MEMBER(tankbust_state::tankbust_soundlatch_w) |
34 | 33 | { |
35 | machine().scheduler().synchronize(FUNC(soundlatch_callback), data); | |
34 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(tankbust_state::soundlatch_callback),this), data); | |
36 | 35 | } |
37 | 36 | |
38 | 37 | READ8_MEMBER(tankbust_state::tankbust_soundlatch_r) |
r18112 | r18113 | |
50 | 49 | return ret; |
51 | 50 | } |
52 | 51 | |
53 | ||
52 | TIMER_CALLBACK_MEMBER(tankbust_state::soundirqline_callback) | |
54 | 53 | { |
55 | 54 | //logerror("sound_irq_line write = %2x (after CPUs synced) \n",param); |
56 | 55 | |
57 | 56 | if ((param & 1) == 0) |
58 | machine.device("sub")->execute().set_input_line(0, HOLD_LINE); | |
57 | machine().device("sub")->execute().set_input_line(0, HOLD_LINE); | |
59 | 58 | } |
60 | 59 | |
61 | 60 | |
r18112 | r18113 | |
79 | 78 | break; |
80 | 79 | |
81 | 80 | case 1: /* 0xe001 (value 0 then 1) written right after the soundlatch_byte_w */ |
82 | machine().scheduler().synchronize(FUNC(soundirqline_callback), data); | |
81 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(tankbust_state::soundirqline_callback),this), data); | |
83 | 82 | break; |
84 | 83 | |
85 | 84 | case 2: /* 0xe002 coin counter */ |
r18112 | r18113 | |
---|---|---|
54 | 54 | device.execute().set_input_line(5, HOLD_LINE); |
55 | 55 | } |
56 | 56 | |
57 | ||
57 | TIMER_CALLBACK_MEMBER(galastrm_state::galastrm_interrupt6) | |
58 | 58 | { |
59 | machine.device("maincpu")->execute().set_input_line(6, HOLD_LINE); | |
59 | machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE); | |
60 | 60 | } |
61 | 61 | |
62 | 62 | |
r18112 | r18113 | |
158 | 158 | |
159 | 159 | WRITE32_MEMBER(galastrm_state::galastrm_adstick_ctrl_w) |
160 | 160 | { |
161 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), FUNC(galastrm_interrupt6)); | |
161 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), timer_expired_delegate(FUNC(galastrm_state::galastrm_interrupt6),this)); | |
162 | 162 | } |
163 | 163 | |
164 | 164 | /*********************************************************** |
r18112 | r18113 | |
---|---|---|
1248 | 1248 | |
1249 | 1249 | ***************************************************************************/ |
1250 | 1250 | |
1251 | ||
1251 | TIMER_CALLBACK_MEMBER(tetrisp2_state::rockn_timer_level4_callback) | |
1252 | 1252 | { |
1253 | machine.device("maincpu")->execute().set_input_line(4, HOLD_LINE); | |
1253 | machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE); | |
1254 | 1254 | } |
1255 | 1255 | |
1256 | ||
1256 | TIMER_CALLBACK_MEMBER(tetrisp2_state::rockn_timer_sub_level4_callback) | |
1257 | 1257 | { |
1258 | machine.device("sub")->execute().set_input_line(4, HOLD_LINE); | |
1258 | machine().device("sub")->execute().set_input_line(4, HOLD_LINE); | |
1259 | 1259 | } |
1260 | 1260 | |
1261 | 1261 | |
1262 | ||
1262 | TIMER_CALLBACK_MEMBER(tetrisp2_state::rockn_timer_level1_callback) | |
1263 | 1263 | { |
1264 | machine.device("maincpu")->execute().set_input_line(1, HOLD_LINE); | |
1264 | machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE); | |
1265 | 1265 | } |
1266 | 1266 | |
1267 | ||
1267 | TIMER_CALLBACK_MEMBER(tetrisp2_state::rockn_timer_sub_level1_callback) | |
1268 | 1268 | { |
1269 | machine.device("sub")->execute().set_input_line(1, HOLD_LINE); | |
1269 | machine().device("sub")->execute().set_input_line(1, HOLD_LINE); | |
1270 | 1270 | } |
1271 | 1271 | |
1272 | 1272 | static void init_rockn_timer(running_machine &machine) |
1273 | 1273 | { |
1274 | 1274 | tetrisp2_state *state = machine.driver_data<tetrisp2_state>(); |
1275 | machine.scheduler().timer_pulse(attotime::from_msec(32), FUNC(rockn_timer_level1_callback)); | |
1276 | state->m_rockn_timer_l4 = machine.scheduler().timer_alloc(FUNC(rockn_timer_level4_callback)); | |
1275 | machine.scheduler().timer_pulse(attotime::from_msec(32), timer_expired_delegate(FUNC(tetrisp2_state::rockn_timer_level1_callback),state)); | |
1276 | state->m_rockn_timer_l4 = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(tetrisp2_state::rockn_timer_level4_callback),state)); | |
1277 | 1277 | |
1278 | 1278 | state_save_register_global_array(machine, state->m_systemregs); |
1279 | 1279 | state_save_register_global_array(machine, state->m_rocknms_sub_systemregs); |
r18112 | r18113 | |
1304 | 1304 | { |
1305 | 1305 | init_rockn_timer(machine()); |
1306 | 1306 | |
1307 | machine().scheduler().timer_pulse(attotime::from_msec(32), FUNC(rockn_timer_sub_level1_callback)); | |
1308 | m_rockn_timer_sub_l4 = machine().scheduler().timer_alloc(FUNC(rockn_timer_sub_level4_callback)); | |
1307 | machine().scheduler().timer_pulse(attotime::from_msec(32), timer_expired_delegate(FUNC(tetrisp2_state::rockn_timer_sub_level1_callback),this)); | |
1308 | m_rockn_timer_sub_l4 = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tetrisp2_state::rockn_timer_sub_level4_callback),this)); | |
1309 | 1309 | |
1310 | 1310 | m_rockn_protectdata = 3; |
1311 | 1311 |
r18112 | r18113 | |
---|---|---|
2705 | 2705 | } |
2706 | 2706 | } |
2707 | 2707 | |
2708 | ||
2708 | TIMER_CALLBACK_MEMBER(namcos22_state::alpine_steplock_callback) | |
2709 | 2709 | { |
2710 | namcos22_state *state = machine.driver_data<namcos22_state>(); | |
2711 | state->m_motor_status = param; | |
2710 | m_motor_status = param; | |
2712 | 2711 | } |
2713 | 2712 | |
2714 | 2713 | WRITE8_MEMBER(namcos22_state::alpine_mcu_port5_w) |
r18112 | r18113 | |
5486 | 5485 | state->m_mcu->space(AS_IO).install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::alpineracer_mcu_adc_r),state)); |
5487 | 5486 | state->m_mcu->space(AS_IO).install_write_handler(M37710_PORT5, M37710_PORT5, write8_delegate(FUNC(namcos22_state::alpine_mcu_port5_w),state)); |
5488 | 5487 | |
5489 | state->m_motor_timer = machine.scheduler().timer_alloc(FUNC(alpine_steplock_callback)); | |
5488 | state->m_motor_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(namcos22_state::alpine_steplock_callback),state)); | |
5490 | 5489 | state->m_motor_timer->reset(); |
5491 | 5490 | state->m_motor_status = 2; |
5492 | 5491 | } |
r18112 | r18113 | |
---|---|---|
132 | 132 | } |
133 | 133 | |
134 | 134 | |
135 | ||
135 | TIMER_CALLBACK_MEMBER(midvunit_state::adc_ready) | |
136 | 136 | { |
137 | machine.device("maincpu")->execute().set_input_line(3, ASSERT_LINE); | |
137 | machine().device("maincpu")->execute().set_input_line(3, ASSERT_LINE); | |
138 | 138 | } |
139 | 139 | |
140 | 140 | |
r18112 | r18113 | |
148 | 148 | if (which < 0 || which > 2) |
149 | 149 | logerror("adc_w: unexpected which = %02X\n", which + 4); |
150 | 150 | m_adc_data = ioport(adcnames[which])->read_safe(0); |
151 | machine().scheduler().timer_set(attotime::from_msec(1), FUNC(adc_ready)); | |
151 | machine().scheduler().timer_set(attotime::from_msec(1), timer_expired_delegate(FUNC(midvunit_state::adc_ready),this)); | |
152 | 152 | } |
153 | 153 | else |
154 | 154 | logerror("adc_w without enabling writes!\n"); |
r18112 | r18113 | |
---|---|---|
73 | 73 | membank("bank1")->set_entry(m_beg_bank & 0xff); /* empty sockets for IC37-IC44 ROMS */ |
74 | 74 | } |
75 | 75 | |
76 | ||
76 | TIMER_CALLBACK_MEMBER(bigevglf_state::from_sound_latch_callback) | |
77 | 77 | { |
78 | bigevglf_state *state = machine.driver_data<bigevglf_state>(); | |
79 | state->m_from_sound = param & 0xff; | |
80 | state->m_sound_state |= 2; | |
78 | m_from_sound = param & 0xff; | |
79 | m_sound_state |= 2; | |
81 | 80 | } |
82 | 81 | WRITE8_MEMBER(bigevglf_state::beg_fromsound_w)/* write to D800 sets bit 1 in status */ |
83 | 82 | { |
84 | machine().scheduler().synchronize(FUNC(from_sound_latch_callback), (space.device().safe_pc() << 16) | data); | |
83 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(bigevglf_state::from_sound_latch_callback),this), (space.device().safe_pc() << 16) | data); | |
85 | 84 | } |
86 | 85 | |
87 | 86 | READ8_MEMBER(bigevglf_state::beg_fromsound_r) |
r18112 | r18113 | |
107 | 106 | return m_sound_state; |
108 | 107 | } |
109 | 108 | |
110 | ||
109 | TIMER_CALLBACK_MEMBER(bigevglf_state::nmi_callback) | |
111 | 110 | { |
112 | bigevglf_state *state = machine.driver_data<bigevglf_state>(); | |
113 | 111 | |
114 | if (state->m_sound_nmi_enable) | |
115 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
112 | if (m_sound_nmi_enable) | |
113 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
116 | 114 | else |
117 | state->m_pending_nmi = 1; | |
118 | state->m_sound_state &= ~1; | |
115 | m_pending_nmi = 1; | |
116 | m_sound_state &= ~1; | |
119 | 117 | } |
120 | 118 | |
121 | 119 | WRITE8_MEMBER(bigevglf_state::sound_command_w)/* write to port 20 clears bit 0 in status */ |
122 | 120 | { |
123 | 121 | m_for_sound = data; |
124 | machine().scheduler().synchronize(FUNC(nmi_callback), data); | |
122 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(bigevglf_state::nmi_callback),this), data); | |
125 | 123 | } |
126 | 124 | |
127 | 125 | READ8_MEMBER(bigevglf_state::sound_command_r)/* read from D800 sets bit 0 in status */ |
r18112 | r18113 | |
145 | 143 | } |
146 | 144 | } |
147 | 145 | |
148 | ||
146 | TIMER_CALLBACK_MEMBER(bigevglf_state::deferred_ls74_w) | |
149 | 147 | { |
150 | bigevglf_state *state = machine.driver_data<bigevglf_state>(); | |
151 | 148 | int offs = (param >> 8) & 255; |
152 | 149 | int data = param & 255; |
153 | | |
150 | m_beg13_ls74[offs] = data; | |
154 | 151 | } |
155 | 152 | |
156 | 153 | /* do this on a timer to let the CPUs synchronize */ |
157 | 154 | WRITE8_MEMBER(bigevglf_state::beg13_a_clr_w) |
158 | 155 | { |
159 | machine().scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 0); | |
156 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(bigevglf_state::deferred_ls74_w),this), (0 << 8) | 0); | |
160 | 157 | } |
161 | 158 | |
162 | 159 | WRITE8_MEMBER(bigevglf_state::beg13_b_clr_w) |
163 | 160 | { |
164 | machine().scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 0); | |
161 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(bigevglf_state::deferred_ls74_w),this), (1 << 8) | 0); | |
165 | 162 | } |
166 | 163 | |
167 | 164 | WRITE8_MEMBER(bigevglf_state::beg13_a_set_w) |
168 | 165 | { |
169 | machine().scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 1); | |
166 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(bigevglf_state::deferred_ls74_w),this), (0 << 8) | 1); | |
170 | 167 | } |
171 | 168 | |
172 | 169 | WRITE8_MEMBER(bigevglf_state::beg13_b_set_w) |
173 | 170 | { |
174 | machine().scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 1); | |
171 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(bigevglf_state::deferred_ls74_w),this), (1 << 8) | 1); | |
175 | 172 | } |
176 | 173 | |
177 | 174 | READ8_MEMBER(bigevglf_state::beg_status_r) |
r18112 | r18113 | |
---|---|---|
522 | 522 | GFXDECODE_END |
523 | 523 | |
524 | 524 | |
525 | ||
525 | TIMER_CALLBACK_MEMBER(namcofl_state::network_interrupt_callback) | |
526 | 526 | { |
527 | machine.device("maincpu")->execute().set_input_line(I960_IRQ0, ASSERT_LINE); | |
528 | machine.scheduler().timer_set(machine.primary_screen->frame_period(), FUNC(network_interrupt_callback)); | |
527 | machine().device("maincpu")->execute().set_input_line(I960_IRQ0, ASSERT_LINE); | |
528 | machine().scheduler().timer_set(machine().primary_screen->frame_period(), timer_expired_delegate(FUNC(namcofl_state::network_interrupt_callback),this)); | |
529 | 529 | } |
530 | 530 | |
531 | 531 | |
532 | ||
532 | TIMER_CALLBACK_MEMBER(namcofl_state::vblank_interrupt_callback) | |
533 | 533 | { |
534 | machine.device("maincpu")->execute().set_input_line(I960_IRQ2, ASSERT_LINE); | |
535 | machine.scheduler().timer_set(machine.primary_screen->frame_period(), FUNC(vblank_interrupt_callback)); | |
534 | machine().device("maincpu")->execute().set_input_line(I960_IRQ2, ASSERT_LINE); | |
535 | machine().scheduler().timer_set(machine().primary_screen->frame_period(), timer_expired_delegate(FUNC(namcofl_state::vblank_interrupt_callback),this)); | |
536 | 536 | } |
537 | 537 | |
538 | 538 | |
539 | ||
539 | TIMER_CALLBACK_MEMBER(namcofl_state::raster_interrupt_callback) | |
540 | 540 | { |
541 | namcofl_state *state = machine.driver_data<namcofl_state>(); | |
542 | machine.primary_screen->update_partial(machine.primary_screen->vpos()); | |
543 | machine.device("maincpu")->execute().set_input_line(I960_IRQ1, ASSERT_LINE); | |
544 | state->m_raster_interrupt_timer->adjust(machine.primary_screen->frame_period()); | |
541 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); | |
542 | machine().device("maincpu")->execute().set_input_line(I960_IRQ1, ASSERT_LINE); | |
543 | m_raster_interrupt_timer->adjust(machine().primary_screen->frame_period()); | |
545 | 544 | } |
546 | 545 | |
547 | 546 | static TIMER_DEVICE_CALLBACK( mcu_irq0_cb ) |
r18112 | r18113 | |
568 | 567 | |
569 | 568 | MACHINE_START_MEMBER(namcofl_state,namcofl) |
570 | 569 | { |
571 | m_raster_interrupt_timer = machine().scheduler().timer_alloc(FUNC(raster_interrupt_callback)); | |
570 | m_raster_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namcofl_state::raster_interrupt_callback),this)); | |
572 | 571 | } |
573 | 572 | |
574 | 573 | |
575 | 574 | MACHINE_RESET_MEMBER(namcofl_state,namcofl) |
576 | 575 | { |
577 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(machine().primary_screen->visible_area().max_y + 3), FUNC(network_interrupt_callback)); | |
578 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(machine().primary_screen->visible_area().max_y + 1), FUNC(vblank_interrupt_callback)); | |
576 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(machine().primary_screen->visible_area().max_y + 3), timer_expired_delegate(FUNC(namcofl_state::network_interrupt_callback),this)); | |
577 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(machine().primary_screen->visible_area().max_y + 1), timer_expired_delegate(FUNC(namcofl_state::vblank_interrupt_callback),this)); | |
579 | 578 | |
580 | 579 | membank("bank1")->set_base(memregion("maincpu")->base() ); |
581 | 580 | membank("bank2")->set_base(m_workram ); |
r18112 | r18113 | |
---|---|---|
635 | 635 | * |
636 | 636 | *************************************/ |
637 | 637 | |
638 | ||
638 | TIMER_CALLBACK_MEMBER(itech32_state::delayed_sound_data_w) | |
639 | 639 | { |
640 | itech32_state *state = machine.driver_data<itech32_state>(); | |
641 | state->m_sound_data = param; | |
642 | state->m_sound_int_state = 1; | |
643 | machine.device("soundcpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE); | |
640 | m_sound_data = param; | |
641 | m_sound_int_state = 1; | |
642 | machine().device("soundcpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE); | |
644 | 643 | } |
645 | 644 | |
646 | 645 | |
647 | 646 | WRITE16_MEMBER(itech32_state::sound_data_w) |
648 | 647 | { |
649 | 648 | if (ACCESSING_BITS_0_7) |
650 | machine().scheduler().synchronize(FUNC(delayed_sound_data_w), data & 0xff); | |
649 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(itech32_state::delayed_sound_data_w),this), data & 0xff); | |
651 | 650 | } |
652 | 651 | |
653 | 652 | |
r18112 | r18113 | |
660 | 659 | WRITE32_MEMBER(itech32_state::sound_data32_w) |
661 | 660 | { |
662 | 661 | if (ACCESSING_BITS_16_23) |
663 | machine().scheduler().synchronize(FUNC(delayed_sound_data_w), (data >> 16) & 0xff); | |
662 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(itech32_state::delayed_sound_data_w),this), (data >> 16) & 0xff); | |
664 | 663 | } |
665 | 664 | |
666 | 665 |
r18112 | r18113 | |
---|---|---|
101 | 101 | #include "includes/bombjack.h" |
102 | 102 | |
103 | 103 | |
104 | ||
104 | TIMER_CALLBACK_MEMBER(bombjack_state::soundlatch_callback) | |
105 | 105 | { |
106 | bombjack_state *state = machine.driver_data<bombjack_state>(); | |
107 | state->m_latch = param; | |
106 | m_latch = param; | |
108 | 107 | } |
109 | 108 | |
110 | 109 | WRITE8_MEMBER(bombjack_state::bombjack_soundlatch_w) |
111 | 110 | { |
112 | 111 | /* make all the CPUs synchronize, and only AFTER that write the new command to the latch */ |
113 | machine().scheduler().synchronize(FUNC(soundlatch_callback), data); | |
112 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(bombjack_state::soundlatch_callback),this), data); | |
114 | 113 | } |
115 | 114 | |
116 | 115 | READ8_MEMBER(bombjack_state::bombjack_soundlatch_r) |
r18112 | r18113 | |
---|---|---|
147 | 147 | * |
148 | 148 | *************************************/ |
149 | 149 | |
150 | ||
150 | TIMER_CALLBACK_MEMBER(crgolf_state::main_to_sound_callback) | |
151 | 151 | { |
152 | crgolf_state *state = machine.driver_data<crgolf_state>(); | |
153 | 152 | |
154 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
155 | state->m_main_to_sound_data = param; | |
153 | m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
154 | m_main_to_sound_data = param; | |
156 | 155 | } |
157 | 156 | |
158 | 157 | |
159 | 158 | WRITE8_MEMBER(crgolf_state::main_to_sound_w) |
160 | 159 | { |
161 | machine().scheduler().synchronize(FUNC(main_to_sound_callback), data); | |
160 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(crgolf_state::main_to_sound_callback),this), data); | |
162 | 161 | } |
163 | 162 | |
164 | 163 | |
r18112 | r18113 | |
177 | 176 | * |
178 | 177 | *************************************/ |
179 | 178 | |
180 | ||
179 | TIMER_CALLBACK_MEMBER(crgolf_state::sound_to_main_callback) | |
181 | 180 | { |
182 | crgolf_state *state = machine.driver_data<crgolf_state>(); | |
183 | 181 | |
184 | state->m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
185 | state->m_sound_to_main_data = param; | |
182 | m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
183 | m_sound_to_main_data = param; | |
186 | 184 | } |
187 | 185 | |
188 | 186 | |
189 | 187 | WRITE8_MEMBER(crgolf_state::sound_to_main_w) |
190 | 188 | { |
191 | machine().scheduler().synchronize(FUNC(sound_to_main_callback), data); | |
189 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(crgolf_state::sound_to_main_callback),this), data); | |
192 | 190 | } |
193 | 191 | |
194 | 192 |
r18112 | r18113 | |
---|---|---|
47 | 47 | INTERRUPTS |
48 | 48 | ***********************************************************/ |
49 | 49 | |
50 | ||
50 | TIMER_CALLBACK_MEMBER(gcpinbal_state::gcpinbal_interrupt1) | |
51 | 51 | { |
52 | gcpinbal_state *state = machine.driver_data<gcpinbal_state>(); | |
53 | state->m_maincpu->set_input_line(1, HOLD_LINE); | |
52 | m_maincpu->set_input_line(1, HOLD_LINE); | |
54 | 53 | } |
55 | 54 | |
56 | 55 | #ifdef UNUSED_FUNCTION |
57 | ||
56 | TIMER_CALLBACK_MEMBER(gcpinbal_state::gcpinbal_interrupt3) | |
58 | 57 | { |
59 | gcpinbal_state *state = machine.driver_data<gcpinbal_state>(); | |
60 | 58 | // IRQ3 is from the M6585 |
61 | 59 | // if (!ADPCM_playing(0)) |
62 | 60 | { |
63 | | |
61 | m_maincpu->set_input_line(3, HOLD_LINE); | |
64 | 62 | } |
65 | 63 | } |
66 | 64 | #endif |
r18112 | r18113 | |
69 | 67 | { |
70 | 68 | /* Unsure of actual sequence */ |
71 | 69 | |
72 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(500), FUNC(gcpinbal_interrupt1)); | |
73 | // machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(1000), FUNC(gcpinbal_interrupt3)); | |
70 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(500), timer_expired_delegate(FUNC(gcpinbal_state::gcpinbal_interrupt1),this)); | |
71 | // machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(1000), timer_expired_delegate(FUNC(gcpinbal_state::gcpinbal_interrupt3),this)); | |
74 | 72 | device.execute().set_input_line(4, HOLD_LINE); |
75 | 73 | } |
76 | 74 |
r18112 | r18113 | |
---|---|---|
384 | 384 | } |
385 | 385 | |
386 | 386 | |
387 | ||
387 | TIMER_CALLBACK_MEMBER(grchamp_state::main_to_sub_comm_sync_w) | |
388 | 388 | { |
389 | grchamp_state *state = machine.driver_data<grchamp_state>(); | |
390 | 389 | int offset = param >> 8; |
391 | | |
390 | m_comm_latch2[offset & 3] = param; | |
392 | 391 | } |
393 | 392 | |
394 | 393 | |
395 | 394 | WRITE8_MEMBER(grchamp_state::main_to_sub_comm_w) |
396 | 395 | { |
397 | machine().scheduler().synchronize(FUNC(main_to_sub_comm_sync_w), data | (offset << 8)); | |
396 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(grchamp_state::main_to_sub_comm_sync_w),this), data | (offset << 8)); | |
398 | 397 | } |
399 | 398 | |
400 | 399 |
r18112 | r18113 | |
---|---|---|
280 | 280 | update_irq(machine()); |
281 | 281 | } |
282 | 282 | |
283 | ||
283 | TIMER_CALLBACK_MEMBER(othunder_state::ad_interrupt) | |
284 | 284 | { |
285 | othunder_state *state = machine.driver_data<othunder_state>(); | |
286 | 285 | |
287 | state->m_ad_irq = 1; | |
288 | update_irq(machine); | |
286 | m_ad_irq = 1; | |
287 | update_irq(machine()); | |
289 | 288 | } |
290 | 289 | |
291 | 290 | |
r18112 | r18113 | |
381 | 380 | The ADC60808 clock is 512kHz. Conversion takes between 0 and 8 clock |
382 | 381 | cycles, so would end in a maximum of 15.625us. We'll use 10. */ |
383 | 382 | |
384 | machine().scheduler().timer_set(attotime::from_usec(10), FUNC(ad_interrupt)); | |
383 | machine().scheduler().timer_set(attotime::from_usec(10), timer_expired_delegate(FUNC(othunder_state::ad_interrupt),this)); | |
385 | 384 | } |
386 | 385 | |
387 | 386 |
r18112 | r18113 | |
---|---|---|
79 | 79 | m_sound_irq_mask = 0; |
80 | 80 | } |
81 | 81 | |
82 | ||
82 | TIMER_CALLBACK_MEMBER(toypop_state::namcoio_run) | |
83 | 83 | { |
84 | device_t *io58xx = machine.device("58xx"); | |
85 | device_t *io56xx_1 = machine.device("56xx_1"); | |
86 | device_t *io56xx_2 = machine.device("56xx_2"); | |
84 | device_t *io58xx = machine().device("58xx"); | |
85 | device_t *io56xx_1 = machine().device("56xx_1"); | |
86 | device_t *io56xx_2 = machine().device("56xx_2"); | |
87 | 87 | |
88 | 88 | switch (param) |
89 | 89 | { |
r18112 | r18113 | |
109 | 109 | device.execute().set_input_line(0, HOLD_LINE); |
110 | 110 | |
111 | 111 | if (!namcoio_read_reset_line(namcoio_0)) /* give the cpu a tiny bit of time to write the command before processing it */ |
112 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run)); | |
112 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(toypop_state::namcoio_run),this)); | |
113 | 113 | |
114 | 114 | if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */ |
115 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run), 1); | |
115 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(toypop_state::namcoio_run),this), 1); | |
116 | 116 | |
117 | 117 | if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */ |
118 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run), 2); | |
118 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(toypop_state::namcoio_run),this), 2); | |
119 | 119 | |
120 | 120 | } |
121 | 121 |
r18112 | r18113 | |
---|---|---|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
44 | ||
44 | TIMER_CALLBACK_MEMBER(sprint4_state::nmi_callback) | |
45 | 45 | { |
46 | sprint4_state *state = machine.driver_data<sprint4_state>(); | |
47 | 46 | int scanline = param; |
48 | 47 | |
49 | 48 | /* MAME updates controls only once per frame but the game checks them on every NMI */ |
50 | 49 | |
51 | 50 | UINT8 wheel[4] = |
52 | 51 | { |
53 | state->ioport("WHEEL1")->read(), | |
54 | state->ioport("WHEEL2")->read(), | |
55 | state->ioport("WHEEL3")->read(), | |
56 | state->ioport("WHEEL4")->read() | |
52 | ioport("WHEEL1")->read(), | |
53 | ioport("WHEEL2")->read(), | |
54 | ioport("WHEEL3")->read(), | |
55 | ioport("WHEEL4")->read() | |
57 | 56 | }; |
58 | 57 | UINT8 lever[4] = |
59 | 58 | { |
60 | machine.root_device().ioport("LEVER1")->read(), | |
61 | machine.root_device().ioport("LEVER2")->read(), | |
62 | machine.root_device().ioport("LEVER3")->read(), | |
63 | machine.root_device().ioport("LEVER4")->read() | |
59 | machine().root_device().ioport("LEVER1")->read(), | |
60 | machine().root_device().ioport("LEVER2")->read(), | |
61 | machine().root_device().ioport("LEVER3")->read(), | |
62 | machine().root_device().ioport("LEVER4")->read() | |
64 | 63 | }; |
65 | 64 | |
66 | 65 | int i; |
r18112 | r18113 | |
69 | 68 | |
70 | 69 | for (i = 0; i < 4; i++) |
71 | 70 | { |
72 | signed char delta = wheel[i] - | |
71 | signed char delta = wheel[i] - m_last_wheel[i]; | |
73 | 72 | |
74 | 73 | if (delta < 0) |
75 | 74 | { |
76 | | |
75 | m_steer_FF2[i] = 0; | |
77 | 76 | } |
78 | 77 | if (delta > 0) |
79 | 78 | { |
80 | | |
79 | m_steer_FF2[i] = 1; | |
81 | 80 | } |
82 | 81 | |
83 | | |
82 | m_steer_FF1[i] = (wheel[i] >> 4) & 1; | |
84 | 83 | |
85 | if (lever[i] & 1) { state->m_gear[i] = 1; } | |
86 | if (lever[i] & 2) { state->m_gear[i] = 2; } | |
87 | if (lever[i] & 4) { state->m_gear[i] = 3; } | |
88 | if (lever[i] & 8) { state->m_gear[i] = 4; } | |
84 | if (lever[i] & 1) { m_gear[i] = 1; } | |
85 | if (lever[i] & 2) { m_gear[i] = 2; } | |
86 | if (lever[i] & 4) { m_gear[i] = 3; } | |
87 | if (lever[i] & 8) { m_gear[i] = 4; } | |
89 | 88 | |
90 | | |
89 | m_last_wheel[i] = wheel[i]; | |
91 | 90 | } |
92 | 91 | |
93 | 92 | scanline += 64; |
r18112 | r18113 | |
99 | 98 | |
100 | 99 | /* NMI and watchdog are disabled during service mode */ |
101 | 100 | |
102 | machine.watchdog_enable(machine.root_device().ioport("IN0")->read() & 0x40); | |
101 | machine().watchdog_enable(machine().root_device().ioport("IN0")->read() & 0x40); | |
103 | 102 | |
104 | if (machine.root_device().ioport("IN0")->read() & 0x40) | |
105 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
103 | if (machine().root_device().ioport("IN0")->read() & 0x40) | |
104 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
106 | 105 | |
107 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(nmi_callback), scanline); | |
106 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(sprint4_state::nmi_callback),this), scanline); | |
108 | 107 | } |
109 | 108 | |
110 | 109 | |
111 | 110 | void sprint4_state::machine_reset() |
112 | 111 | { |
113 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(32), FUNC(nmi_callback), 32); | |
112 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(32), timer_expired_delegate(FUNC(sprint4_state::nmi_callback),this), 32); | |
114 | 113 | |
115 | 114 | memset(m_steer_FF1, 0, sizeof m_steer_FF1); |
116 | 115 | memset(m_steer_FF2, 0, sizeof m_steer_FF2); |
r18112 | r18113 | |
---|---|---|
70 | 70 | m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 1 ) ? ASSERT_LINE : CLEAR_LINE); |
71 | 71 | } |
72 | 72 | |
73 | ||
73 | TIMER_CALLBACK_MEMBER(ladyfrog_state::nmi_callback) | |
74 | 74 | { |
75 | ladyfrog_state *state = machine.driver_data<ladyfrog_state>(); | |
76 | 75 | |
77 | if (state->m_sound_nmi_enable) | |
78 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
76 | if (m_sound_nmi_enable) | |
77 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
79 | 78 | else |
80 | | |
79 | m_pending_nmi = 1; | |
81 | 80 | } |
82 | 81 | |
83 | 82 | WRITE8_MEMBER(ladyfrog_state::sound_command_w) |
84 | 83 | { |
85 | 84 | soundlatch_byte_w(space, 0, data); |
86 | machine().scheduler().synchronize(FUNC(nmi_callback), data); | |
85 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(ladyfrog_state::nmi_callback),this), data); | |
87 | 86 | } |
88 | 87 | |
89 | 88 | WRITE8_MEMBER(ladyfrog_state::nmi_disable_w) |
r18112 | r18113 | |
---|---|---|
163 | 163 | * |
164 | 164 | *************************************/ |
165 | 165 | |
166 | ||
166 | TIMER_CALLBACK_MEMBER(esripsys_state::delayed_bank_swap) | |
167 | 167 | { |
168 | esripsys_state *state = machine.driver_data<esripsys_state>(); | |
169 | state->m_fasel ^= 1; | |
170 | state->m_fbsel ^= 1; | |
168 | m_fasel ^= 1; | |
169 | m_fbsel ^= 1; | |
171 | 170 | } |
172 | 171 | |
173 | 172 | WRITE8_MEMBER(esripsys_state::frame_w) |
174 | 173 | { |
175 | machine().scheduler().synchronize(FUNC(delayed_bank_swap)); | |
174 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(esripsys_state::delayed_bank_swap),this)); | |
176 | 175 | m_frame_vbl = 1; |
177 | 176 | } |
178 | 177 |
r18112 | r18113 | |
---|---|---|
293 | 293 | |
294 | 294 | /*************/ |
295 | 295 | |
296 | ||
296 | TIMER_CALLBACK_MEMBER(qdrmfgp_state::gp2_timer_callback) | |
297 | 297 | { |
298 | qdrmfgp_state *state = machine.driver_data<qdrmfgp_state>(); | |
299 | if (state->m_control & 0x0004) | |
300 | machine.device("maincpu")->execute().set_input_line(3, HOLD_LINE); | |
298 | if (m_control & 0x0004) | |
299 | machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE); | |
301 | 300 | } |
302 | 301 | |
303 | 302 | INTERRUPT_GEN_MEMBER(qdrmfgp_state::qdrmfgp2_interrupt) |
r18112 | r18113 | |
644 | 643 | MACHINE_START_MEMBER(qdrmfgp_state,qdrmfgp2) |
645 | 644 | { |
646 | 645 | /* sound irq (CCU? 240Hz) */ |
647 | machine().scheduler().timer_pulse(attotime::from_hz(18432000/76800), FUNC(gp2_timer_callback)); | |
646 | machine().scheduler().timer_pulse(attotime::from_hz(18432000/76800), timer_expired_delegate(FUNC(qdrmfgp_state::gp2_timer_callback),this)); | |
648 | 647 | |
649 | 648 | MACHINE_START_CALL_MEMBER( qdrmfgp ); |
650 | 649 | } |
r18112 | r18113 | |
---|---|---|
268 | 268 | } |
269 | 269 | |
270 | 270 | |
271 | ||
271 | TIMER_CALLBACK_MEMBER(neogeo_state::display_position_interrupt_callback) | |
272 | 272 | { |
273 | neogeo_state *state = machine.driver_data<neogeo_state>(); | |
274 | 273 | |
275 | if (LOG_VIDEO_SYSTEM) logerror("--- Scanline @ %d,%d\n", machine.primary_screen->vpos(), machine.primary_screen->hpos()); | |
274 | if (LOG_VIDEO_SYSTEM) logerror("--- Scanline @ %d,%d\n", machine().primary_screen->vpos(), machine().primary_screen->hpos()); | |
276 | 275 | |
277 | if ( | |
276 | if (m_display_position_interrupt_control & IRQ2CTRL_ENABLE) | |
278 | 277 | { |
279 | if (LOG_VIDEO_SYSTEM) logerror("*** Scanline interrupt (IRQ2) *** y: %02x x: %02x\n", machine.primary_screen->vpos(), machine.primary_screen->hpos()); | |
280 | state->m_display_position_interrupt_pending = 1; | |
278 | if (LOG_VIDEO_SYSTEM) logerror("*** Scanline interrupt (IRQ2) *** y: %02x x: %02x\n", machine().primary_screen->vpos(), machine().primary_screen->hpos()); | |
279 | m_display_position_interrupt_pending = 1; | |
281 | 280 | |
282 | update_interrupts(machine); | |
281 | update_interrupts(machine()); | |
283 | 282 | } |
284 | 283 | |
285 | if ( | |
284 | if (m_display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_REPEAT) | |
286 | 285 | { |
287 | 286 | if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_REPEAT "); |
288 | adjust_display_position_interrupt_timer(machine); | |
287 | adjust_display_position_interrupt_timer(machine()); | |
289 | 288 | } |
290 | 289 | } |
291 | 290 | |
292 | 291 | |
293 | ||
292 | TIMER_CALLBACK_MEMBER(neogeo_state::display_position_vblank_callback) | |
294 | 293 | { |
295 | neogeo_state *state = machine.driver_data<neogeo_state>(); | |
296 | 294 | |
297 | if ( | |
295 | if (m_display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_VBLANK) | |
298 | 296 | { |
299 | 297 | if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_VBLANK "); |
300 | adjust_display_position_interrupt_timer(machine); | |
298 | adjust_display_position_interrupt_timer(machine()); | |
301 | 299 | } |
302 | 300 | |
303 | 301 | /* set timer for next screen */ |
304 | | |
302 | m_display_position_vblank_timer->adjust(machine().primary_screen->time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS)); | |
305 | 303 | } |
306 | 304 | |
307 | 305 | |
308 | ||
306 | TIMER_CALLBACK_MEMBER(neogeo_state::vblank_interrupt_callback) | |
309 | 307 | { |
310 | neogeo_state *state = machine.driver_data<neogeo_state>(); | |
311 | 308 | |
312 | if (LOG_VIDEO_SYSTEM) logerror("+++ VBLANK @ %d,%d\n", machine.primary_screen->vpos(), machine.primary_screen->hpos()); | |
309 | if (LOG_VIDEO_SYSTEM) logerror("+++ VBLANK @ %d,%d\n", machine().primary_screen->vpos(), machine().primary_screen->hpos()); | |
313 | 310 | |
314 | 311 | /* add a timer tick to the pd4990a */ |
315 | upd4990a_addretrace( | |
312 | upd4990a_addretrace(m_upd4990a); | |
316 | 313 | |
317 | | |
314 | m_vblank_interrupt_pending = 1; | |
318 | 315 | |
319 | update_interrupts(machine); | |
316 | update_interrupts(machine()); | |
320 | 317 | |
321 | 318 | /* set timer for next screen */ |
322 | | |
319 | m_vblank_interrupt_timer->adjust(machine().primary_screen->time_until_pos(NEOGEO_VBSTART)); | |
323 | 320 | } |
324 | 321 | |
325 | 322 | |
326 | 323 | static void create_interrupt_timers( running_machine &machine ) |
327 | 324 | { |
328 | 325 | neogeo_state *state = machine.driver_data<neogeo_state>(); |
329 | state->m_display_position_interrupt_timer = machine.scheduler().timer_alloc(FUNC(display_position_interrupt_callback)); | |
330 | state->m_display_position_vblank_timer = machine.scheduler().timer_alloc(FUNC(display_position_vblank_callback)); | |
331 | state->m_vblank_interrupt_timer = machine.scheduler().timer_alloc(FUNC(vblank_interrupt_callback)); | |
326 | state->m_display_position_interrupt_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(neogeo_state::display_position_interrupt_callback),state)); | |
327 | state->m_display_position_vblank_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(neogeo_state::display_position_vblank_callback),state)); | |
328 | state->m_vblank_interrupt_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(neogeo_state::vblank_interrupt_callback),state)); | |
332 | 329 | } |
333 | 330 | |
334 | 331 |
r18112 | r18113 | |
---|---|---|
113 | 113 | state->m_maincpu->set_input_line(state->m_irq_level, CLEAR_LINE); |
114 | 114 | } |
115 | 115 | |
116 | ||
116 | TIMER_CALLBACK_MEMBER(cave_state::cave_vblank_end) | |
117 | 117 | { |
118 | cave_state *state = machine.driver_data<cave_state>(); | |
119 | if (state->m_kludge == 3) /* mazinger metmqstr */ | |
118 | if (m_kludge == 3) /* mazinger metmqstr */ | |
120 | 119 | { |
121 | state->m_unknown_irq = 1; | |
122 | update_irq_state(machine); | |
120 | m_unknown_irq = 1; | |
121 | update_irq_state(machine()); | |
123 | 122 | } |
124 | | |
123 | m_agallet_vblank_irq = 0; | |
125 | 124 | } |
126 | 125 | |
127 | 126 | static TIMER_DEVICE_CALLBACK( cave_vblank_start ) |
r18112 | r18113 | |
131 | 130 | update_irq_state(timer.machine()); |
132 | 131 | cave_get_sprite_info(timer.machine()); |
133 | 132 | state->m_agallet_vblank_irq = 1; |
134 | timer.machine().scheduler().timer_set(attotime::from_usec(2000), FUNC(cave_vblank_end)); | |
133 | timer.machine().scheduler().timer_set(attotime::from_usec(2000), timer_expired_delegate(FUNC(cave_state::cave_vblank_end),state)); | |
135 | 134 | } |
136 | 135 | |
137 | 136 | /* Called once/frame to generate the VBLANK interrupt */ |
r18112 | r18113 | |
---|---|---|
129 | 129 | * |
130 | 130 | ***************************************************/ |
131 | 131 | |
132 | ||
132 | TIMER_CALLBACK_MEMBER(dec8_state::dec8_i8751_timer_callback) | |
133 | 133 | { |
134 | 134 | // The schematics show a clocked LS194 shift register (3A) is used to automatically |
135 | 135 | // clear the IRQ request. The MCU does not clear it itself. |
136 | dec8_state *state = machine.driver_data<dec8_state>(); | |
137 | state->m_mcu->execute().set_input_line(MCS51_INT1_LINE, CLEAR_LINE); | |
136 | m_mcu->execute().set_input_line(MCS51_INT1_LINE, CLEAR_LINE); | |
138 | 137 | } |
139 | 138 | |
140 | 139 | WRITE8_MEMBER(dec8_state::dec8_i8751_w) |
r18112 | r18113 | |
145 | 144 | case 0: /* High byte - SECIRQ is trigged on activating this latch */ |
146 | 145 | m_i8751_value = (m_i8751_value & 0xff) | (data << 8); |
147 | 146 | m_mcu->execute().set_input_line(MCS51_INT1_LINE, ASSERT_LINE); |
148 | machine().scheduler().timer_set(m_mcu->clocks_to_attotime(64), FUNC(dec8_i8751_timer_callback)); // 64 clocks not confirmed | |
147 | machine().scheduler().timer_set(m_mcu->clocks_to_attotime(64), timer_expired_delegate(FUNC(dec8_state::dec8_i8751_timer_callback),this)); // 64 clocks not confirmed | |
149 | 148 | break; |
150 | 149 | case 1: /* Low byte */ |
151 | 150 | m_i8751_value = (m_i8751_value & 0xff00) | data; |
r18112 | r18113 | |
---|---|---|
293 | 293 | return tms5110_romclk_hack_r(device, space, 0) ? 0x80 : 0; |
294 | 294 | } |
295 | 295 | |
296 | ||
296 | TIMER_CALLBACK_MEMBER(cvs_state::cvs_393hz_timer_cb) | |
297 | 297 | { |
298 | cvs_state *state = machine.driver_data<cvs_state>(); | |
299 | state->m_cvs_393hz_clock = !state->m_cvs_393hz_clock; | |
298 | m_cvs_393hz_clock = !m_cvs_393hz_clock; | |
300 | 299 | |
301 | 300 | /* quasar.c games use this timer but have no dac3! */ |
302 | if ( | |
301 | if (m_dac3 != NULL) | |
303 | 302 | { |
304 | if (state->m_dac3_state[2]) | |
305 | state->m_dac3->write_unsigned8(state->m_cvs_393hz_clock * 0xff); | |
303 | if (m_dac3_state[2]) | |
304 | m_dac3->write_unsigned8(m_cvs_393hz_clock * 0xff); | |
306 | 305 | } |
307 | 306 | } |
308 | 307 | |
r18112 | r18113 | |
310 | 309 | static void start_393hz_timer(running_machine &machine) |
311 | 310 | { |
312 | 311 | cvs_state *state = machine.driver_data<cvs_state>(); |
313 | state->m_cvs_393hz_timer = machine.scheduler().timer_alloc(FUNC(cvs_393hz_timer_cb)); | |
312 | state->m_cvs_393hz_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(cvs_state::cvs_393hz_timer_cb),state)); | |
314 | 313 | state->m_cvs_393hz_timer->adjust(attotime::from_hz(30*393), 0, attotime::from_hz(30*393)); |
315 | 314 | } |
316 | 315 |
r18112 | r18113 | |
---|---|---|
34 | 34 | m_snd_flag = 2; |
35 | 35 | } |
36 | 36 | |
37 | ||
37 | TIMER_CALLBACK_MEMBER(flstory_state::nmi_callback) | |
38 | 38 | { |
39 | flstory_state *state = machine.driver_data<flstory_state>(); | |
40 | if (state->m_sound_nmi_enable) | |
41 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
39 | if (m_sound_nmi_enable) | |
40 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
42 | 41 | else |
43 | | |
42 | m_pending_nmi = 1; | |
44 | 43 | } |
45 | 44 | |
46 | 45 | WRITE8_MEMBER(flstory_state::sound_command_w) |
47 | 46 | { |
48 | 47 | soundlatch_byte_w(space, 0, data); |
49 | machine().scheduler().synchronize(FUNC(nmi_callback), data); | |
48 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(flstory_state::nmi_callback),this), data); | |
50 | 49 | } |
51 | 50 | |
52 | 51 |
r18112 | r18113 | |
---|---|---|
66 | 66 | * |
67 | 67 | *************************************/ |
68 | 68 | |
69 | ||
69 | TIMER_CALLBACK_MEMBER(atetris_state::interrupt_gen) | |
70 | 70 | { |
71 | atetris_state *state = machine.driver_data<atetris_state>(); | |
72 | 71 | int scanline = param; |
73 | 72 | |
74 | 73 | /* assert/deassert the interrupt */ |
75 | machine.device("maincpu")->execute().set_input_line(0, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE); | |
74 | machine().device("maincpu")->execute().set_input_line(0, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE); | |
76 | 75 | |
77 | 76 | /* set the next timer */ |
78 | 77 | scanline += 32; |
79 | 78 | if (scanline >= 256) |
80 | 79 | scanline -= 256; |
81 | | |
80 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
82 | 81 | } |
83 | 82 | |
84 | 83 | |
r18112 | r18113 | |
107 | 106 | { |
108 | 107 | |
109 | 108 | /* Allocate interrupt timer */ |
110 | m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(interrupt_gen)); | |
109 | m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(atetris_state::interrupt_gen),this)); | |
111 | 110 | |
112 | 111 | /* Set up save state */ |
113 | 112 | save_item(NAME(m_current_bank)); |
r18112 | r18113 | |
---|---|---|
52 | 52 | |
53 | 53 | /*********************************************************************/ |
54 | 54 | |
55 | ||
55 | TIMER_CALLBACK_MEMBER(gunbustr_state::gunbustr_interrupt5) | |
56 | 56 | { |
57 | machine.device("maincpu")->execute().set_input_line(5, HOLD_LINE); | |
57 | machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE); | |
58 | 58 | } |
59 | 59 | |
60 | 60 | INTERRUPT_GEN_MEMBER(gunbustr_state::gunbustr_interrupt) |
61 | 61 | { |
62 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000-500), FUNC(gunbustr_interrupt5)); | |
62 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000-500), timer_expired_delegate(FUNC(gunbustr_state::gunbustr_interrupt5),this)); | |
63 | 63 | device.execute().set_input_line(4, HOLD_LINE); |
64 | 64 | } |
65 | 65 | |
r18112 | r18113 | |
143 | 143 | WRITE32_MEMBER(gunbustr_state::gunbustr_gun_w) |
144 | 144 | { |
145 | 145 | /* 10000 cycle delay is arbitrary */ |
146 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), FUNC(gunbustr_interrupt5)); | |
146 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), timer_expired_delegate(FUNC(gunbustr_state::gunbustr_interrupt5),this)); | |
147 | 147 | } |
148 | 148 | |
149 | 149 |
r18112 | r18113 | |
---|---|---|
201 | 201 | update_irq_state(machine()); |
202 | 202 | } |
203 | 203 | |
204 | ||
204 | TIMER_CALLBACK_MEMBER(metro_state::karatour_irq_callback) | |
205 | 205 | { |
206 | metro_state *state = machine.driver_data<metro_state>(); | |
207 | state->m_requested_int[5] = 0; | |
206 | m_requested_int[5] = 0; | |
208 | 207 | } |
209 | 208 | |
210 | 209 | /* lev 2-7 (lev 1 seems sound related) */ |
r18112 | r18113 | |
214 | 213 | m_requested_int[m_vblank_bit] = 1; |
215 | 214 | |
216 | 215 | /* write to scroll registers, the duration is a guess */ |
217 | machine().scheduler().timer_set(attotime::from_usec(2500), FUNC(karatour_irq_callback)); | |
216 | machine().scheduler().timer_set(attotime::from_usec(2500), timer_expired_delegate(FUNC(metro_state::karatour_irq_callback),this)); | |
218 | 217 | m_requested_int[5] = 1; |
219 | 218 | |
220 | 219 | update_irq_state(machine()); |
221 | 220 | } |
222 | 221 | |
223 | ||
222 | TIMER_CALLBACK_MEMBER(metro_state::mouja_irq_callback) | |
224 | 223 | { |
225 | metro_state *state = machine.driver_data<metro_state>(); | |
226 | 224 | |
227 | state->m_requested_int[0] = 1; | |
228 | update_irq_state(machine); | |
225 | m_requested_int[0] = 1; | |
226 | update_irq_state(machine()); | |
229 | 227 | } |
230 | 228 | |
231 | 229 | WRITE16_MEMBER(metro_state::mouja_irq_timer_ctrl_w) |
r18112 | r18113 | |
564 | 562 | |
565 | 563 | ***************************************************************************/ |
566 | 564 | |
567 | ||
565 | TIMER_CALLBACK_MEMBER(metro_state::metro_blit_done) | |
568 | 566 | { |
569 | metro_state *state = machine.driver_data<metro_state>(); | |
570 | state->m_requested_int[state->m_blitter_bit] = 1; | |
571 | update_irq_state(machine); | |
567 | m_requested_int[m_blitter_bit] = 1; | |
568 | update_irq_state(machine()); | |
572 | 569 | } |
573 | 570 | |
574 | 571 | INLINE int blt_read( const UINT8 *ROM, const int offs ) |
r18112 | r18113 | |
639 | 636 | another blit. */ |
640 | 637 | if (b1 == 0) |
641 | 638 | { |
642 | machine().scheduler().timer_set(attotime::from_usec(500), FUNC(metro_blit_done)); | |
639 | machine().scheduler().timer_set(attotime::from_usec(500), timer_expired_delegate(FUNC(metro_state::metro_blit_done),this)); | |
643 | 640 | return; |
644 | 641 | } |
645 | 642 | |
r18112 | r18113 | |
6033 | 6030 | metro_common(machine()); |
6034 | 6031 | m_irq_line = -1; /* split interrupt handlers */ |
6035 | 6032 | m_vblank_bit = 1; |
6036 | m_mouja_irq_timer = machine().scheduler().timer_alloc(FUNC(mouja_irq_callback)); | |
6033 | m_mouja_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(metro_state::mouja_irq_callback),this)); | |
6037 | 6034 | } |
6038 | 6035 | |
6039 | 6036 | DRIVER_INIT_MEMBER(metro_state,gakusai) |
r18112 | r18113 | |
---|---|---|
597 | 597 | 12Mhz dotclock: 42.7us(clear) / 341.3us(transfer) |
598 | 598 | */ |
599 | 599 | |
600 | ||
600 | TIMER_CALLBACK_MEMBER(konamigx_state::dmaend_callback) | |
601 | 601 | { |
602 | 602 | // foul-proof (CPU0 could be deactivated while we wait) |
603 | if (resume_trigger && suspension_active) { suspension_active = 0; machine.scheduler().trigger(resume_trigger); } | |
603 | if (resume_trigger && suspension_active) { suspension_active = 0; machine().scheduler().trigger(resume_trigger); } | |
604 | 604 | |
605 | 605 | // DMA busy flag must be cleared before triggering IRQ 3 |
606 | 606 | gx_rdport1_3 &= ~2; |
r18112 | r18113 | |
612 | 612 | |
613 | 613 | // lower OBJINT-REQ flag and trigger interrupt |
614 | 614 | gx_rdport1_3 &= ~0x80; |
615 | machine.device("maincpu")->execute().set_input_line(3, HOLD_LINE); | |
615 | machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE); | |
616 | 616 | } |
617 | 617 | } |
618 | 618 | |
r18112 | r18113 | |
3729 | 3729 | snd020_hack = 0; |
3730 | 3730 | resume_trigger = 0; |
3731 | 3731 | |
3732 | dmadelay_timer = machine().scheduler().timer_alloc(FUNC(dmaend_callback)); | |
3732 | dmadelay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(konamigx_state::dmaend_callback),this)); | |
3733 | 3733 | i = match = 0; |
3734 | 3734 | while ((gameDefs[i].cfgport != -1) && (!match)) |
3735 | 3735 | { |
r18112 | r18113 | |
---|---|---|
121 | 121 | } |
122 | 122 | #endif |
123 | 123 | |
124 | ||
124 | TIMER_CALLBACK_MEMBER(parodius_state::nmi_callback) | |
125 | 125 | { |
126 | parodius_state *state = machine.driver_data<parodius_state>(); | |
127 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
126 | m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
128 | 127 | } |
129 | 128 | |
130 | 129 | WRITE8_MEMBER(parodius_state::sound_arm_nmi_w) |
131 | 130 | { |
132 | 131 | |
133 | 132 | m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); |
134 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(nmi_callback)); /* kludge until the K053260 is emulated correctly */ | |
133 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(parodius_state::nmi_callback),this)); /* kludge until the K053260 is emulated correctly */ | |
135 | 134 | } |
136 | 135 | |
137 | 136 | /********************************************/ |
r18112 | r18113 | |
---|---|---|
156 | 156 | * |
157 | 157 | *************************************/ |
158 | 158 | |
159 | ||
159 | TIMER_CALLBACK_MEMBER(rpunch_state::sound_command_w_callback) | |
160 | 160 | { |
161 | rpunch_state *state = machine.driver_data<rpunch_state>(); | |
162 | state->m_sound_busy = 1; | |
163 | state->m_sound_data = param; | |
164 | machine.device("audiocpu")->execute().set_input_line(0, (state->m_ym2151_irq | state->m_sound_busy) ? ASSERT_LINE : CLEAR_LINE); | |
161 | m_sound_busy = 1; | |
162 | m_sound_data = param; | |
163 | machine().device("audiocpu")->execute().set_input_line(0, (m_ym2151_irq | m_sound_busy) ? ASSERT_LINE : CLEAR_LINE); | |
165 | 164 | } |
166 | 165 | |
167 | 166 | |
168 | 167 | WRITE16_MEMBER(rpunch_state::sound_command_w) |
169 | 168 | { |
170 | 169 | if (ACCESSING_BITS_0_7) |
171 | machine().scheduler().synchronize(FUNC(sound_command_w_callback), data & 0xff); | |
170 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(rpunch_state::sound_command_w_callback),this), data & 0xff); | |
172 | 171 | } |
173 | 172 | |
174 | 173 |
r18112 | r18113 | |
---|---|---|
122 | 122 | } |
123 | 123 | |
124 | 124 | |
125 | ||
125 | TIMER_CALLBACK_MEMBER(cloud9_state::clock_irq) | |
126 | 126 | { |
127 | cloud9_state *state = machine.driver_data<cloud9_state>(); | |
128 | 127 | /* assert the IRQ if not already asserted */ |
129 | if (! | |
128 | if (!m_irq_state) | |
130 | 129 | { |
131 | state->m_maincpu->set_input_line(0, ASSERT_LINE); | |
132 | state->m_irq_state = 1; | |
130 | m_maincpu->set_input_line(0, ASSERT_LINE); | |
131 | m_irq_state = 1; | |
133 | 132 | } |
134 | 133 | |
135 | 134 | /* force an update now */ |
136 | machine.primary_screen->update_partial(machine.primary_screen->vpos()); | |
135 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); | |
137 | 136 | |
138 | 137 | /* find the next edge */ |
139 | schedule_next_irq(machine, param); | |
138 | schedule_next_irq(machine(), param); | |
140 | 139 | } |
141 | 140 | |
142 | 141 | |
r18112 | r18113 | |
181 | 180 | machine().primary_screen->configure(320, 256, visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL); |
182 | 181 | |
183 | 182 | /* create a timer for IRQs and set up the first callback */ |
184 | m_irq_timer = machine().scheduler().timer_alloc(FUNC(clock_irq)); | |
183 | m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(cloud9_state::clock_irq),this)); | |
185 | 184 | m_irq_state = 0; |
186 | 185 | schedule_next_irq(machine(), 0-64); |
187 | 186 |
r18112 | r18113 | |
---|---|---|
123 | 123 | * |
124 | 124 | *************************************/ |
125 | 125 | |
126 | ||
126 | TIMER_CALLBACK_MEMBER(jedi_state::generate_interrupt) | |
127 | 127 | { |
128 | jedi_state *state = machine.driver_data<jedi_state>(); | |
129 | 128 | int scanline = param; |
130 | 129 | |
131 | 130 | /* IRQ is set by /32V */ |
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); | |
131 | machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, (scanline & 32) ? CLEAR_LINE : ASSERT_LINE); | |
132 | machine().device("audiocpu")->execute().set_input_line(M6502_IRQ_LINE, (scanline & 32) ? CLEAR_LINE : ASSERT_LINE); | |
134 | 133 | |
135 | 134 | /* set up for the next */ |
136 | 135 | scanline += 32; |
137 | 136 | if (scanline > 256) |
138 | 137 | scanline = 32; |
139 | | |
138 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
140 | 139 | } |
141 | 140 | |
142 | 141 | |
r18112 | r18113 | |
157 | 156 | { |
158 | 157 | |
159 | 158 | /* set a timer to run the interrupts */ |
160 | m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(generate_interrupt)); | |
159 | m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(jedi_state::generate_interrupt),this)); | |
161 | 160 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(32), 32); |
162 | 161 | |
163 | 162 | /* configure the banks */ |
r18112 | r18113 | |
---|---|---|
198 | 198 | k053246_set_objcha_line(m_k053246, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); |
199 | 199 | } |
200 | 200 | |
201 | ||
201 | TIMER_CALLBACK_MEMBER(vendetta_state::z80_nmi_callback) | |
202 | 202 | { |
203 | vendetta_state *state = machine.driver_data<vendetta_state>(); | |
204 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
203 | m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
205 | 204 | } |
206 | 205 | |
207 | 206 | WRITE8_MEMBER(vendetta_state::z80_arm_nmi_w) |
208 | 207 | { |
209 | 208 | m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); |
210 | 209 | |
211 | machine().scheduler().timer_set(attotime::from_usec(25), FUNC(z80_nmi_callback)); | |
210 | machine().scheduler().timer_set(attotime::from_usec(25), timer_expired_delegate(FUNC(vendetta_state::z80_nmi_callback),this)); | |
212 | 211 | } |
213 | 212 | |
214 | 213 | WRITE8_MEMBER(vendetta_state::z80_irq_w) |
r18112 | r18113 | |
---|---|---|
390 | 390 | |
391 | 391 | /******************************************************************************/ |
392 | 392 | |
393 | ||
393 | TIMER_CALLBACK_MEMBER(taito_f3_state::f3_interrupt3) | |
394 | 394 | { |
395 | machine.device("maincpu")->execute().set_input_line(3, HOLD_LINE); // some signal from video hardware? | |
395 | machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE); // some signal from video hardware? | |
396 | 396 | } |
397 | 397 | |
398 | 398 | INTERRUPT_GEN_MEMBER(taito_f3_state::f3_interrupt2) |
399 | 399 | { |
400 | 400 | device.execute().set_input_line(2, HOLD_LINE); // vblank |
401 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(10000), FUNC(f3_interrupt3)); | |
401 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(10000), timer_expired_delegate(FUNC(taito_f3_state::f3_interrupt3),this)); | |
402 | 402 | } |
403 | 403 | |
404 | 404 | static SOUND_RESET( f3 ) |
r18112 | r18113 | |
---|---|---|
134 | 134 | m_maincpu->set_input_line(0, CLEAR_LINE); |
135 | 135 | } |
136 | 136 | |
137 | ||
137 | TIMER_CALLBACK_MEMBER(champbas_state::exctsccr_fm_callback) | |
138 | 138 | { |
139 | champbas_state *state = machine.driver_data<champbas_state>(); | |
140 | state->m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); | |
139 | m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); | |
141 | 140 | } |
142 | 141 | |
143 | 142 | // Champion Baseball has only one DAC |
r18112 | r18113 | |
591 | 590 | m_audiocpu = machine().device<cpu_device>("audiocpu"); |
592 | 591 | |
593 | 592 | // FIXME |
594 | machine().scheduler().timer_pulse(attotime::from_hz(75), FUNC(exctsccr_fm_callback)); /* updates fm */ | |
593 | machine().scheduler().timer_pulse(attotime::from_hz(75), timer_expired_delegate(FUNC(champbas_state::exctsccr_fm_callback),this)); /* updates fm */ | |
595 | 594 | |
596 | 595 | MACHINE_START_CALL_MEMBER(champbas); |
597 | 596 | } |
r18112 | r18113 | |
---|---|---|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | ||
173 | TIMER_CALLBACK_MEMBER(exterm_state::sound_delayed_w) | |
174 | 174 | { |
175 | exterm_state *state = machine.driver_data<exterm_state>(); | |
176 | 175 | /* data is latched independently for both sound CPUs */ |
177 | state->m_master_sound_latch = state->m_slave_sound_latch = param; | |
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); | |
176 | m_master_sound_latch = m_slave_sound_latch = param; | |
177 | machine().device("audiocpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); | |
178 | machine().device("audioslave")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); | |
180 | 179 | } |
181 | 180 | |
182 | 181 | |
183 | 182 | WRITE16_MEMBER(exterm_state::sound_latch_w) |
184 | 183 | { |
185 | 184 | if (ACCESSING_BITS_0_7) |
186 | machine().scheduler().synchronize(FUNC(sound_delayed_w), data & 0xff); | |
185 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(exterm_state::sound_delayed_w),this), data & 0xff); | |
187 | 186 | } |
188 | 187 | |
189 | 188 |
r18112 | r18113 | |
---|---|---|
522 | 522 | |
523 | 523 | ***************************************************************************/ |
524 | 524 | |
525 | ||
525 | TIMER_CALLBACK_MEMBER(fuuki32_state::level_1_interrupt_callback) | |
526 | 526 | { |
527 | fuuki32_state *state = machine.driver_data<fuuki32_state>(); | |
528 | state->m_maincpu->set_input_line(1, HOLD_LINE); | |
529 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback)); | |
527 | m_maincpu->set_input_line(1, HOLD_LINE); | |
528 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(248), timer_expired_delegate(FUNC(fuuki32_state::level_1_interrupt_callback),this)); | |
530 | 529 | } |
531 | 530 | |
532 | 531 | |
533 | ||
532 | TIMER_CALLBACK_MEMBER(fuuki32_state::vblank_interrupt_callback) | |
534 | 533 | { |
535 | fuuki32_state *state = machine.driver_data<fuuki32_state>(); | |
536 | state->m_maincpu->set_input_line(3, HOLD_LINE); // VBlank IRQ | |
537 | machine.scheduler().timer_set(machine.primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback)); | |
534 | m_maincpu->set_input_line(3, HOLD_LINE); // VBlank IRQ | |
535 | machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_start(), timer_expired_delegate(FUNC(fuuki32_state::vblank_interrupt_callback),this)); | |
538 | 536 | } |
539 | 537 | |
540 | 538 | |
541 | ||
539 | TIMER_CALLBACK_MEMBER(fuuki32_state::raster_interrupt_callback) | |
542 | 540 | { |
543 | fuuki32_state *state = machine.driver_data<fuuki32_state>(); | |
544 | state->m_maincpu->set_input_line(5, HOLD_LINE); // Raster Line IRQ | |
545 | machine.primary_screen->update_partial(machine.primary_screen->vpos()); | |
546 | state->m_raster_interrupt_timer->adjust(machine.primary_screen->frame_period()); | |
541 | m_maincpu->set_input_line(5, HOLD_LINE); // Raster Line IRQ | |
542 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); | |
543 | m_raster_interrupt_timer->adjust(machine().primary_screen->frame_period()); | |
547 | 544 | } |
548 | 545 | |
549 | 546 | |
r18112 | r18113 | |
556 | 553 | m_maincpu = machine().device<cpu_device>("maincpu"); |
557 | 554 | m_audiocpu = machine().device<cpu_device>("soundcpu"); |
558 | 555 | |
559 | m_raster_interrupt_timer = machine().scheduler().timer_alloc(FUNC(raster_interrupt_callback)); | |
556 | m_raster_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fuuki32_state::raster_interrupt_callback),this)); | |
560 | 557 | |
561 | 558 | save_item(NAME(m_spr_buffered_tilebank)); |
562 | 559 | save_item(NAME(m_shared_ram)); |
r18112 | r18113 | |
567 | 564 | { |
568 | 565 | const rectangle &visarea = machine().primary_screen->visible_area(); |
569 | 566 | |
570 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback)); | |
571 | machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback)); | |
567 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(248), timer_expired_delegate(FUNC(fuuki32_state::level_1_interrupt_callback),this)); | |
568 | machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_start(), timer_expired_delegate(FUNC(fuuki32_state::vblank_interrupt_callback),this)); | |
572 | 569 | m_raster_interrupt_timer->adjust(machine().primary_screen->time_until_pos(0, visarea.max_x + 1)); |
573 | 570 | } |
574 | 571 |
r18112 | r18113 | |
---|---|---|
9 | 9 | #include "sound/s14001a.h" |
10 | 10 | #include "includes/wolfpack.h" |
11 | 11 | |
12 | ||
12 | TIMER_CALLBACK_MEMBER(wolfpack_state::periodic_callback) | |
13 | 13 | { |
14 | 14 | int scanline = param; |
15 | 15 | |
16 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
16 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
17 | 17 | |
18 | 18 | scanline += 64; |
19 | 19 | |
20 | 20 | if (scanline >= 262) |
21 | 21 | scanline = 0; |
22 | 22 | |
23 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(periodic_callback), scanline); | |
23 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(wolfpack_state::periodic_callback),this), scanline); | |
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | 27 | void wolfpack_state::machine_reset() |
28 | 28 | { |
29 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), FUNC(periodic_callback)); | |
29 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(wolfpack_state::periodic_callback),this)); | |
30 | 30 | } |
31 | 31 | |
32 | 32 |
r18112 | r18113 | |
---|---|---|
270 | 270 | } |
271 | 271 | } |
272 | 272 | |
273 | ||
273 | TIMER_CALLBACK_MEMBER(nycaptor_state::nmi_callback) | |
274 | 274 | { |
275 | nycaptor_state *state = machine.driver_data<nycaptor_state>(); | |
276 | if (state->m_sound_nmi_enable) | |
277 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
275 | if (m_sound_nmi_enable) | |
276 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
278 | 277 | else |
279 | | |
278 | m_pending_nmi = 1; | |
280 | 279 | } |
281 | 280 | |
282 | 281 | WRITE8_MEMBER(nycaptor_state::sound_command_w) |
283 | 282 | { |
284 | 283 | soundlatch_byte_w(space, 0, data); |
285 | machine().scheduler().synchronize(FUNC(nmi_callback), data); | |
284 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(nycaptor_state::nmi_callback),this), data); | |
286 | 285 | } |
287 | 286 | |
288 | 287 | WRITE8_MEMBER(nycaptor_state::nmi_disable_w) |
r18112 | r18113 | |
---|---|---|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
47 | ||
47 | TIMER_CALLBACK_MEMBER(trucocl_state::dac_irq) | |
48 | 48 | { |
49 | machine.device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE ); | |
49 | machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE ); | |
50 | 50 | } |
51 | 51 | |
52 | 52 | WRITE8_MEMBER(trucocl_state::audio_dac_w) |
r18112 | r18113 | |
76 | 76 | |
77 | 77 | device->write_unsigned8( rom[dac_address+m_cur_dac_address_index] ); |
78 | 78 | |
79 | machine().scheduler().timer_set( attotime::from_hz( 16000 ), FUNC(dac_irq | |
79 | machine().scheduler().timer_set( attotime::from_hz( 16000 ), timer_expired_delegate(FUNC(trucocl_state::dac_irq),this)); | |
80 | 80 | } |
81 | 81 | |
82 | 82 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, trucocl_state ) |
r18112 | r18113 | |
---|---|---|
152 | 152 | } |
153 | 153 | |
154 | 154 | |
155 | ||
155 | TIMER_CALLBACK_MEMBER(ccastles_state::clock_irq) | |
156 | 156 | { |
157 | ccastles_state *state = machine.driver_data<ccastles_state>(); | |
158 | 157 | |
159 | 158 | /* assert the IRQ if not already asserted */ |
160 | if (! | |
159 | if (!m_irq_state) | |
161 | 160 | { |
162 | state->m_maincpu->set_input_line(0, ASSERT_LINE); | |
163 | state->m_irq_state = 1; | |
161 | m_maincpu->set_input_line(0, ASSERT_LINE); | |
162 | m_irq_state = 1; | |
164 | 163 | } |
165 | 164 | |
166 | 165 | /* force an update now */ |
167 | machine.primary_screen->update_partial(machine.primary_screen->vpos()); | |
166 | machine().primary_screen->update_partial(machine().primary_screen->vpos()); | |
168 | 167 | |
169 | 168 | /* find the next edge */ |
170 | schedule_next_irq(machine, param); | |
169 | schedule_next_irq(machine(), param); | |
171 | 170 | } |
172 | 171 | |
173 | 172 | |
r18112 | r18113 | |
215 | 214 | membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0xa000, 0x6000); |
216 | 215 | |
217 | 216 | /* create a timer for IRQs and set up the first callback */ |
218 | m_irq_timer = machine().scheduler().timer_alloc(FUNC(clock_irq)); | |
217 | m_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ccastles_state::clock_irq),this)); | |
219 | 218 | m_irq_state = 0; |
220 | 219 | schedule_next_irq(machine(), 0); |
221 | 220 |
r18112 | r18113 | |
---|---|---|
101 | 101 | * |
102 | 102 | *************************************/ |
103 | 103 | |
104 | ||
104 | TIMER_CALLBACK_MEMBER(policetr_state::irq5_gen) | |
105 | 105 | { |
106 | machine.device("maincpu")->execute().set_input_line(R3000_IRQ5, ASSERT_LINE); | |
106 | machine().device("maincpu")->execute().set_input_line(R3000_IRQ5, ASSERT_LINE); | |
107 | 107 | } |
108 | 108 | |
109 | 109 | |
110 | 110 | INTERRUPT_GEN_MEMBER(policetr_state::irq4_gen) |
111 | 111 | { |
112 | 112 | device.execute().set_input_line(R3000_IRQ4, ASSERT_LINE); |
113 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), FUNC(irq5_gen)); | |
113 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(policetr_state::irq5_gen),this)); | |
114 | 114 | } |
115 | 115 | |
116 | 116 |
r18112 | r18113 | |
---|---|---|
108 | 108 | } |
109 | 109 | } |
110 | 110 | |
111 | ||
111 | TIMER_CALLBACK_MEMBER(gijoe_state::dmaend_callback) | |
112 | 112 | { |
113 | gijoe_state *state = machine.driver_data<gijoe_state>(); | |
114 | 113 | |
115 | if (state->m_cur_control2 & 0x0020) | |
116 | state->m_maincpu->set_input_line(6, HOLD_LINE); | |
114 | if (m_cur_control2 & 0x0020) | |
115 | m_maincpu->set_input_line(6, HOLD_LINE); | |
117 | 116 | } |
118 | 117 | |
119 | 118 | INTERRUPT_GEN_MEMBER(gijoe_state::gijoe_interrupt) |
r18112 | r18113 | |
280 | 279 | m_k053246 = machine().device("k053246"); |
281 | 280 | m_k053251 = machine().device("k053251"); |
282 | 281 | |
283 | m_dmadelay_timer = machine().scheduler().timer_alloc(FUNC(dmaend_callback)); | |
282 | m_dmadelay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gijoe_state::dmaend_callback),this)); | |
284 | 283 | |
285 | 284 | save_item(NAME(m_cur_control2)); |
286 | 285 | } |
r18112 | r18113 | |
---|---|---|
604 | 604 | * |
605 | 605 | *************************************/ |
606 | 606 | |
607 | ||
607 | TIMER_CALLBACK_MEMBER(itech8_state::irq_off) | |
608 | 608 | { |
609 | itech8_update_interrupts(machine, 0, -1, -1); | |
609 | itech8_update_interrupts(machine(), 0, -1, -1); | |
610 | 610 | } |
611 | 611 | |
612 | 612 | |
r18112 | r18113 | |
614 | 614 | { |
615 | 615 | /* signal the NMI */ |
616 | 616 | itech8_update_interrupts(machine(), 1, -1, -1); |
617 | machine().scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off)); | |
617 | machine().scheduler().timer_set(attotime::from_usec(1), timer_expired_delegate(FUNC(itech8_state::irq_off),this)); | |
618 | 618 | |
619 | 619 | if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", machine().primary_screen->vpos()); |
620 | 620 | } |
r18112 | r18113 | |
640 | 640 | * |
641 | 641 | *************************************/ |
642 | 642 | |
643 | static TIMER_CALLBACK( behind_the_beam_update ); | |
644 | 643 | |
645 | 644 | |
645 | ||
646 | 646 | MACHINE_START_MEMBER(itech8_state,sstrike) |
647 | 647 | { |
648 | 648 | /* we need to update behind the beam as well */ |
649 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), FUNC(behind_the_beam_update), 32); | |
649 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(itech8_state::behind_the_beam_update),this), 32); | |
650 | 650 | } |
651 | 651 | |
652 | 652 | void itech8_state::machine_reset() |
r18112 | r18113 | |
676 | 676 | * |
677 | 677 | *************************************/ |
678 | 678 | |
679 | ||
679 | TIMER_CALLBACK_MEMBER(itech8_state::behind_the_beam_update) | |
680 | 680 | { |
681 | 681 | int scanline = param >> 8; |
682 | 682 | int interval = param & 0xff; |
683 | 683 | |
684 | 684 | /* force a partial update to the current scanline */ |
685 | machine.primary_screen->update_partial(scanline); | |
685 | machine().primary_screen->update_partial(scanline); | |
686 | 686 | |
687 | 687 | /* advance by the interval, and wrap to 0 */ |
688 | 688 | scanline += interval; |
689 | 689 | if (scanline >= 256) scanline = 0; |
690 | 690 | |
691 | 691 | /* set a new timer */ |
692 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(behind_the_beam_update), (scanline << 8) + interval); | |
692 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(itech8_state::behind_the_beam_update),this), (scanline << 8) + interval); | |
693 | 693 | } |
694 | 694 | |
695 | 695 | |
r18112 | r18113 | |
779 | 779 | * |
780 | 780 | *************************************/ |
781 | 781 | |
782 | ||
782 | TIMER_CALLBACK_MEMBER(itech8_state::delayed_sound_data_w) | |
783 | 783 | { |
784 | itech8_state *state = machine.driver_data<itech8_state>(); | |
785 | state->m_sound_data = param; | |
786 | machine.device("soundcpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE); | |
784 | m_sound_data = param; | |
785 | machine().device("soundcpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE); | |
787 | 786 | } |
788 | 787 | |
789 | 788 | |
790 | 789 | WRITE8_MEMBER(itech8_state::sound_data_w) |
791 | 790 | { |
792 | machine().scheduler().synchronize(FUNC(delayed_sound_data_w), data); | |
791 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(itech8_state::delayed_sound_data_w),this), data); | |
793 | 792 | } |
794 | 793 | |
795 | 794 | |
r18112 | r18113 | |
800 | 799 | ((data & 0x5d) << 1) | |
801 | 800 | ((data & 0x20) >> 3) | |
802 | 801 | ((data & 0x02) << 5); |
803 | machine().scheduler().synchronize(FUNC(delayed_sound_data_w), data); | |
802 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(itech8_state::delayed_sound_data_w),this), data); | |
804 | 803 | } |
805 | 804 | |
806 | 805 |
r18112 | r18113 | |
---|---|---|
504 | 504 | } |
505 | 505 | |
506 | 506 | |
507 | ||
507 | TIMER_CALLBACK_MEMBER(m10_state::interrupt_callback) | |
508 | 508 | { |
509 | m10_state *state = machine.driver_data<m10_state>(); | |
510 | 509 | if (param == 0) |
511 | 510 | { |
512 | state->m_maincpu->set_input_line(0, ASSERT_LINE); | |
513 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(IREMM10_VBSTART + 16), FUNC(interrupt_callback), 1); | |
511 | m_maincpu->set_input_line(0, ASSERT_LINE); | |
512 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(IREMM10_VBSTART + 16), timer_expired_delegate(FUNC(m10_state::interrupt_callback),this), 1); | |
514 | 513 | } |
515 | 514 | if (param == 1) |
516 | 515 | { |
517 | state->m_maincpu->set_input_line(0, ASSERT_LINE); | |
518 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(IREMM10_VBSTART + 24), FUNC(interrupt_callback), 2); | |
516 | m_maincpu->set_input_line(0, ASSERT_LINE); | |
517 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(IREMM10_VBSTART + 24), timer_expired_delegate(FUNC(m10_state::interrupt_callback),this), 2); | |
519 | 518 | } |
520 | 519 | if (param == -1) |
521 | | |
520 | m_maincpu->set_input_line(0, CLEAR_LINE); | |
522 | 521 | |
523 | 522 | } |
524 | 523 | |
r18112 | r18113 | |
526 | 525 | INTERRUPT_GEN_MEMBER(m10_state::m11_interrupt) |
527 | 526 | { |
528 | 527 | device.execute().set_input_line(0, ASSERT_LINE); |
529 | //machine().scheduler().timer_set(machine.primary_screen->time_until_pos(IREMM10_VBEND), FUNC(interrupt_callback), -1); | |
528 | //machine().scheduler().timer_set(machine.primary_screen->time_until_pos(IREMM10_VBEND), timer_expired_delegate(FUNC(m10_state::interrupt_callback),this), -1); | |
530 | 529 | } |
531 | 530 | |
532 | 531 | INTERRUPT_GEN_MEMBER(m10_state::m10_interrupt) |
r18112 | r18113 | |
538 | 537 | INTERRUPT_GEN_MEMBER(m10_state::m15_interrupt) |
539 | 538 | { |
540 | 539 | device.execute().set_input_line(0, ASSERT_LINE); |
541 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(IREMM10_VBSTART + 1, 80), FUNC(interrupt_callback), -1); | |
540 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(IREMM10_VBSTART + 1, 80), timer_expired_delegate(FUNC(m10_state::interrupt_callback),this), -1); | |
542 | 541 | } |
543 | 542 | |
544 | 543 | /************************************* |
r18112 | r18113 | |
---|---|---|
1019 | 1019 | |
1020 | 1020 | /* 68000 A */ |
1021 | 1021 | |
1022 | ||
1022 | TIMER_CALLBACK_MEMBER(taitoz_state::taitoz_interrupt6) | |
1023 | 1023 | { |
1024 | taitoz_state *state = machine.driver_data<taitoz_state>(); | |
1025 | state->m_maincpu->set_input_line(6, HOLD_LINE); | |
1024 | m_maincpu->set_input_line(6, HOLD_LINE); | |
1026 | 1025 | } |
1027 | 1026 | |
1028 | 1027 | /* 68000 B */ |
1029 | 1028 | |
1030 | ||
1029 | TIMER_CALLBACK_MEMBER(taitoz_state::taitoz_cpub_interrupt5) | |
1031 | 1030 | { |
1032 | taitoz_state *state = machine.driver_data<taitoz_state>(); | |
1033 | state->m_subcpu->set_input_line(5, HOLD_LINE); | |
1031 | m_subcpu->set_input_line(5, HOLD_LINE); | |
1034 | 1032 | } |
1035 | 1033 | |
1036 | 1034 | |
r18112 | r18113 | |
1045 | 1043 | m_sci_int6 = !m_sci_int6; |
1046 | 1044 | |
1047 | 1045 | if (m_sci_int6) |
1048 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000 - 500), FUNC(taitoz_interrupt6)); | |
1046 | machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000 - 500), timer_expired_delegate(FUNC(taitoz_state::taitoz_interrupt6),this)); | |
1049 | 1047 | |
1050 | 1048 | device.execute().set_input_line(4, HOLD_LINE); |
1051 | 1049 | } |
r18112 | r18113 | |
1229 | 1227 | but we don't want CPUA to have an int6 before int4 is over (?) |
1230 | 1228 | */ |
1231 | 1229 | |
1232 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), FUNC(taitoz_interrupt6)); | |
1230 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), timer_expired_delegate(FUNC(taitoz_state::taitoz_interrupt6),this)); | |
1233 | 1231 | } |
1234 | 1232 | |
1235 | 1233 | |
r18112 | r18113 | |
1294 | 1292 | Four lightgun interrupts happen before the collected coords |
1295 | 1293 | are moved to shared ram where CPUA can use them. */ |
1296 | 1294 | |
1297 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), FUNC(taitoz_cpub_interrupt5)); | |
1295 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), timer_expired_delegate(FUNC(taitoz_state::taitoz_cpub_interrupt5),this)); | |
1298 | 1296 | } |
1299 | 1297 | |
1300 | 1298 | WRITE16_MEMBER(taitoz_state::spacegun_gun_output_w) |
r18112 | r18113 | |
---|---|---|
22 | 22 | */ |
23 | 23 | |
24 | 24 | |
25 | ||
25 | TIMER_CALLBACK_MEMBER(msisaac_state::nmi_callback) | |
26 | 26 | { |
27 | msisaac_state *state = machine.driver_data<msisaac_state>(); | |
28 | if (state->m_sound_nmi_enable) | |
29 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
27 | if (m_sound_nmi_enable) | |
28 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
30 | 29 | else |
31 | | |
30 | m_pending_nmi = 1; | |
32 | 31 | } |
33 | 32 | |
34 | 33 | WRITE8_MEMBER(msisaac_state::sound_command_w) |
35 | 34 | { |
36 | 35 | soundlatch_byte_w(space, 0, data); |
37 | machine().scheduler().synchronize(FUNC(nmi_callback), data); | |
36 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(msisaac_state::nmi_callback),this), data); | |
38 | 37 | } |
39 | 38 | |
40 | 39 | WRITE8_MEMBER(msisaac_state::nmi_disable_w) |
r18112 | r18113 | |
---|---|---|
144 | 144 | } |
145 | 145 | |
146 | 146 | |
147 | ||
147 | TIMER_CALLBACK_MEMBER(psikyo_state::psikyo_soundlatch_callback) | |
148 | 148 | { |
149 | psikyo_state *state = machine.driver_data<psikyo_state>(); | |
150 | state->m_soundlatch = param; | |
151 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
152 | state->m_z80_nmi = 1; | |
149 | m_soundlatch = param; | |
150 | m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
151 | m_z80_nmi = 1; | |
153 | 152 | } |
154 | 153 | |
155 | 154 | WRITE32_MEMBER(psikyo_state::psikyo_soundlatch_w) |
156 | 155 | { |
157 | 156 | if (ACCESSING_BITS_0_7) |
158 | machine().scheduler().synchronize(FUNC(psikyo_soundlatch_callback), data & 0xff); | |
157 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(psikyo_state::psikyo_soundlatch_callback),this), data & 0xff); | |
159 | 158 | } |
160 | 159 | |
161 | 160 | /*************************************************************************** |
r18112 | r18113 | |
165 | 164 | WRITE32_MEMBER(psikyo_state::s1945_soundlatch_w) |
166 | 165 | { |
167 | 166 | if (ACCESSING_BITS_16_23) |
168 | machine().scheduler().synchronize(FUNC(psikyo_soundlatch_callback), (data >> 16) & 0xff); | |
167 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(psikyo_state::psikyo_soundlatch_callback),this), (data >> 16) & 0xff); | |
169 | 168 | } |
170 | 169 | |
171 | 170 | static const UINT8 s1945_table[256] = { |
r18112 | r18113 | |
---|---|---|
395 | 395 | |
396 | 396 | /******************************************************************************/ |
397 | 397 | |
398 | ||
398 | TIMER_CALLBACK_MEMBER(equites_state::equites_nmi_callback) | |
399 | 399 | { |
400 | equites_state *state = machine.driver_data<equites_state>(); | |
401 | state->m_audio_cpu->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
400 | m_audio_cpu->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
402 | 401 | } |
403 | 402 | |
404 | ||
403 | TIMER_CALLBACK_MEMBER(equites_state::equites_frq_adjuster_callback) | |
405 | 404 | { |
406 | equites_state *state = machine.driver_data<equites_state>(); | |
407 | UINT8 frq = state->ioport(FRQ_ADJUSTER_TAG)->read(); | |
405 | UINT8 frq = ioport(FRQ_ADJUSTER_TAG)->read(); | |
408 | 406 | |
409 | msm5232_set_clock(state->m_msm, MSM5232_MIN_CLOCK + frq * (MSM5232_MAX_CLOCK - MSM5232_MIN_CLOCK) / 100); | |
410 | //popmessage("8155: C %02x A %02x AY: A %02x B %02x Unk:%x", state->m_eq8155_port_c, state->m_eq8155_port_a, state->m_ay_port_a, state->m_ay_port_b, state->m_eq_cymbal_ctrl & 15); | |
407 | msm5232_set_clock(m_msm, MSM5232_MIN_CLOCK + frq * (MSM5232_MAX_CLOCK - MSM5232_MIN_CLOCK) / 100); | |
408 | //popmessage("8155: C %02x A %02x AY: A %02x B %02x Unk:%x", m_eq8155_port_c, m_eq8155_port_a, m_ay_port_a, m_ay_port_b, m_eq_cymbal_ctrl & 15); | |
411 | 409 | |
412 | state->m_cymvol *= 0.94f; | |
413 | state->m_hihatvol *= 0.94f; | |
410 | m_cymvol *= 0.94f; | |
411 | m_hihatvol *= 0.94f; | |
414 | 412 | |
415 | | |
413 | m_msm->set_output_gain(10, m_hihatvol + m_cymvol * (m_ay_port_b & 3) * 0.33); /* NO from msm5232 */ | |
416 | 414 | } |
417 | 415 | |
418 | 416 | static SOUND_START(equites) |
419 | 417 | { |
420 | 418 | equites_state *state = machine.driver_data<equites_state>(); |
421 | state->m_nmi_timer = machine.scheduler().timer_alloc(FUNC(equites_nmi_callback)); | |
419 | state->m_nmi_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(equites_state::equites_nmi_callback),state)); | |
422 | 420 | |
423 | state->m_adjuster_timer = machine.scheduler().timer_alloc(FUNC(equites_frq_adjuster_callback)); | |
421 | state->m_adjuster_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(equites_state::equites_frq_adjuster_callback),state)); | |
424 | 422 | state->m_adjuster_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60)); |
425 | 423 | } |
426 | 424 |
r18112 | r18113 | |
---|---|---|
1221 | 1221 | ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x007fffff, FALSE, state->m_work_ram); |
1222 | 1222 | } |
1223 | 1223 | |
1224 | ||
1224 | TIMER_CALLBACK_MEMBER(model3_state::model3_sound_timer_tick) | |
1225 | 1225 | { |
1226 | model3_state *state = machine.driver_data<model3_state>(); | |
1227 | 1226 | |
1228 | if ( | |
1227 | if (m_sound_irq_enable) | |
1229 | 1228 | { |
1230 | model3_set_irq_line(machine, 0x40, ASSERT_LINE); | |
1229 | model3_set_irq_line(machine(), 0x40, ASSERT_LINE); | |
1231 | 1230 | } |
1232 | 1231 | } |
1233 | 1232 | |
r18112 | r18113 | |
1235 | 1234 | { |
1236 | 1235 | configure_fast_ram(machine()); |
1237 | 1236 | |
1238 | m_sound_timer = machine().scheduler().timer_alloc(FUNC(model3_sound_timer_tick)); | |
1237 | m_sound_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::model3_sound_timer_tick),this)); | |
1239 | 1238 | } |
1240 | 1239 | MACHINE_START_MEMBER(model3_state,model3_15) |
1241 | 1240 | { |
1242 | 1241 | configure_fast_ram(machine()); |
1243 | 1242 | |
1244 | m_sound_timer = machine().scheduler().timer_alloc(FUNC(model3_sound_timer_tick)); | |
1243 | m_sound_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::model3_sound_timer_tick),this)); | |
1245 | 1244 | } |
1246 | 1245 | MACHINE_START_MEMBER(model3_state,model3_20) |
1247 | 1246 | { |
1248 | 1247 | configure_fast_ram(machine()); |
1249 | 1248 | |
1250 | m_sound_timer = machine().scheduler().timer_alloc(FUNC(model3_sound_timer_tick)); | |
1249 | m_sound_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::model3_sound_timer_tick),this)); | |
1251 | 1250 | } |
1252 | 1251 | MACHINE_START_MEMBER(model3_state,model3_21) |
1253 | 1252 | { |
1254 | 1253 | configure_fast_ram(machine()); |
1255 | 1254 | |
1256 | m_sound_timer = machine().scheduler().timer_alloc(FUNC(model3_sound_timer_tick)); | |
1255 | m_sound_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(model3_state::model3_sound_timer_tick),this)); | |
1257 | 1256 | } |
1258 | 1257 | |
1259 | 1258 | static void model3_init(running_machine &machine, int step) |
r18112 | r18113 | |
---|---|---|
873 | 873 | } |
874 | 874 | |
875 | 875 | |
876 | ||
876 | TIMER_CALLBACK_MEMBER(mw8080bw_state::maze_tone_timing_timer_callback) | |
877 | 877 | { |
878 | mw8080bw_state *state = machine.driver_data<mw8080bw_state>(); | |
879 | state->m_maze_tone_timing_state = !state->m_maze_tone_timing_state; | |
880 | maze_write_discrete(state->m_discrete, state->m_maze_tone_timing_state); | |
878 | m_maze_tone_timing_state = !m_maze_tone_timing_state; | |
879 | maze_write_discrete(m_discrete, m_maze_tone_timing_state); | |
881 | 880 | } |
882 | 881 | |
883 | 882 | |
r18112 | r18113 | |
885 | 884 | { |
886 | 885 | |
887 | 886 | /* create astable timer for IC B1 */ |
888 | machine().scheduler().timer_pulse(MAZE_555_B1_PERIOD, FUNC(maze_tone_timing_timer_callback)); | |
887 | machine().scheduler().timer_pulse(MAZE_555_B1_PERIOD, timer_expired_delegate(FUNC(mw8080bw_state::maze_tone_timing_timer_callback),this)); | |
889 | 888 | |
890 | 889 | /* initialize state of Tone Timing FF, IC C1 */ |
891 | 890 | m_maze_tone_timing_state = 0; |
r18112 | r18113 | |
---|---|---|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
59 | ||
59 | TIMER_CALLBACK_MEMBER(firetrk_state::periodic_callback) | |
60 | 60 | { |
61 | 61 | int scanline = param; |
62 | 62 | |
63 | generic_pulse_irq_line(machine.device("maincpu"), 0, 1); | |
63 | generic_pulse_irq_line(machine().device("maincpu")->execute(), 0, 1); | |
64 | 64 | |
65 | 65 | /* IRQs are generated by inverse 16V signal */ |
66 | 66 | scanline += 32; |
r18112 | r18113 | |
68 | 68 | if (scanline > 262) |
69 | 69 | scanline = 0; |
70 | 70 | |
71 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(periodic_callback), scanline); | |
71 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(firetrk_state::periodic_callback),this), scanline); | |
72 | 72 | } |
73 | 73 | |
74 | 74 | |
r18112 | r18113 | |
165 | 165 | { |
166 | 166 | set_service_mode(machine(), 0); |
167 | 167 | |
168 | machine().scheduler().synchronize(FUNC(periodic_callback)); | |
168 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(firetrk_state::periodic_callback),this)); | |
169 | 169 | } |
170 | 170 | |
171 | 171 |
r18112 | r18113 | |
---|---|---|
361 | 361 | * |
362 | 362 | *************************************/ |
363 | 363 | |
364 | ||
364 | TIMER_CALLBACK_MEMBER(gaelco3d_state::delayed_sound_w) | |
365 | 365 | { |
366 | gaelco3d_state *state = machine.driver_data<gaelco3d_state>(); | |
367 | 366 | if (LOG) |
368 | 367 | logerror("delayed_sound_w(%02X)\n", param); |
369 | state->m_sound_data = param; | |
370 | machine.device("adsp")->execute().set_input_line(ADSP2115_IRQ2, ASSERT_LINE); | |
368 | m_sound_data = param; | |
369 | machine().device("adsp")->execute().set_input_line(ADSP2115_IRQ2, ASSERT_LINE); | |
371 | 370 | } |
372 | 371 | |
373 | 372 | |
r18112 | r18113 | |
376 | 375 | if (LOG) |
377 | 376 | logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask); |
378 | 377 | if (ACCESSING_BITS_0_7) |
379 | machine().scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff); | |
378 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(gaelco3d_state::delayed_sound_w),this), data & 0xff); | |
380 | 379 | } |
381 | 380 | |
382 | 381 |
r18112 | r18113 | |
---|---|---|
1401 | 1401 | /*------------------------------ |
1402 | 1402 | callback |
1403 | 1403 | ------------------------------*/ |
1404 | ||
1404 | TIMER_CALLBACK_MEMBER(seta_state::uPD71054_timer_callback) | |
1405 | 1405 | { |
1406 | machine.device("maincpu")->execute().set_input_line(4, HOLD_LINE ); | |
1407 | uPD71054_update_timer( machine, NULL, param ); | |
1406 | machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE ); | |
1407 | uPD71054_update_timer( machine(), NULL, param ); | |
1408 | 1408 | } |
1409 | 1409 | |
1410 | 1410 | |
r18112 | r18113 | |
1424 | 1424 | uPD71054->max[no] = 0xffff; |
1425 | 1425 | } |
1426 | 1426 | for( no = 0; no < USED_TIMER_NUM; no++ ) { |
1427 | uPD71054->timer[no] = machine.scheduler().timer_alloc( | |
1427 | uPD71054->timer[no] = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(seta_state::uPD71054_timer_callback),state)); | |
1428 | 1428 | } |
1429 | 1429 | } |
1430 | 1430 | |
r18112 | r18113 | |
2140 | 2140 | return result; |
2141 | 2141 | } |
2142 | 2142 | |
2143 | ||
2143 | TIMER_CALLBACK_MEMBER(seta_state::keroppi_prize_hop_callback) | |
2144 | 2144 | { |
2145 | seta_state *state = machine.driver_data<seta_state>(); | |
2146 | state->m_keroppi_prize_hop = 2; | |
2145 | m_keroppi_prize_hop = 2; | |
2147 | 2146 | } |
2148 | 2147 | |
2149 | 2148 | WRITE16_MEMBER(seta_state::keroppi_prize_w) |
r18112 | r18113 | |
2151 | 2150 | if ((data & 0x0010) && !m_keroppi_prize_hop) |
2152 | 2151 | { |
2153 | 2152 | m_keroppi_prize_hop = 1; |
2154 | machine().scheduler().timer_set(attotime::from_seconds(3), FUNC(keroppi_prize_hop_callback), 0x20); /* 3 seconds */ | |
2153 | machine().scheduler().timer_set(attotime::from_seconds(3), timer_expired_delegate(FUNC(seta_state::keroppi_prize_hop_callback),this), 0x20); /* 3 seconds */ | |
2155 | 2154 | } |
2156 | 2155 | } |
2157 | 2156 |
r18112 | r18113 | |
---|---|---|
296 | 296 | } |
297 | 297 | |
298 | 298 | |
299 | ||
299 | TIMER_CALLBACK_MEMBER(namconb1_state::namconb1_TriggerPOSIRQ) | |
300 | 300 | { |
301 | namconb1_state *state = machine.driver_data<namconb1_state>(); | |
302 | if(state->m_pos_irq_active || !(state->m_namconb_cpureg[0x02] & 0xf0)) | |
301 | if(m_pos_irq_active || !(m_namconb_cpureg[0x02] & 0xf0)) | |
303 | 302 | return; |
304 | 303 | |
305 | machine.primary_screen->update_partial(param); | |
306 | state->m_pos_irq_active = 1; | |
307 | machine.device("maincpu")->execute().set_input_line(state->m_namconb_cpureg[0x02] & 0xf, ASSERT_LINE); | |
304 | machine().primary_screen->update_partial(param); | |
305 | m_pos_irq_active = 1; | |
306 | machine().device("maincpu")->execute().set_input_line(m_namconb_cpureg[0x02] & 0xf, ASSERT_LINE); | |
308 | 307 | } |
309 | 308 | |
310 | 309 | INTERRUPT_GEN_MEMBER(namconb1_state::namconb1_interrupt) |
r18112 | r18113 | |
356 | 355 | } |
357 | 356 | if( scanline < NAMCONB1_VBSTART ) |
358 | 357 | { |
359 | machine().scheduler().timer_set( machine().primary_screen->time_until_pos(scanline), FUNC(namconb1_TriggerPOSIRQ | |
358 | machine().scheduler().timer_set( machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(namconb1_state::namconb1_TriggerPOSIRQ),this), scanline); | |
360 | 359 | } |
361 | 360 | } /* namconb1_interrupt */ |
362 | 361 | |
363 | 362 | |
364 | ||
363 | TIMER_CALLBACK_MEMBER(namconb1_state::namconb2_TriggerPOSIRQ) | |
365 | 364 | { |
366 | namconb1_state *state = machine.driver_data<namconb1_state>(); | |
367 | machine.primary_screen->update_partial(param); | |
368 | state->m_pos_irq_active = 1; | |
369 | machine.device("maincpu")->execute().set_input_line(state->m_namconb_cpureg[0x02], ASSERT_LINE); | |
365 | machine().primary_screen->update_partial(param); | |
366 | m_pos_irq_active = 1; | |
367 | machine().device("maincpu")->execute().set_input_line(m_namconb_cpureg[0x02], ASSERT_LINE); | |
370 | 368 | } |
371 | 369 | |
372 | 370 | INTERRUPT_GEN_MEMBER(namconb1_state::namconb2_interrupt) |
r18112 | r18113 | |
411 | 409 | scanline = 0; |
412 | 410 | |
413 | 411 | if( scanline < NAMCONB1_VBSTART ) |
414 | machine().scheduler().timer_set( machine().primary_screen->time_until_pos(scanline), FUNC(namconb2_TriggerPOSIRQ | |
412 | machine().scheduler().timer_set( machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(namconb1_state::namconb2_TriggerPOSIRQ),this), scanline); | |
415 | 413 | } /* namconb2_interrupt */ |
416 | 414 | |
417 | 415 | static void namconb1_cpureg8_w(running_machine &machine, int reg, UINT8 data) |
r18112 | r18113 | |
---|---|---|
425 | 425 | |
426 | 426 | /* Machine Start */ |
427 | 427 | |
428 | ||
428 | TIMER_CALLBACK_MEMBER(cidelsa_state::set_cpu_mode) | |
429 | 429 | { |
430 | cidelsa_state *state = machine.driver_data<cidelsa_state>(); | |
431 | 430 | |
432 | | |
431 | m_reset = 1; | |
433 | 432 | } |
434 | 433 | |
435 | 434 | void cidelsa_state::machine_start() |
r18112 | r18113 | |
456 | 455 | { |
457 | 456 | /* reset the CPU */ |
458 | 457 | m_reset = 0; |
459 | machine().scheduler().timer_set(attotime::from_msec(200), FUNC(set_cpu_mode)); | |
458 | machine().scheduler().timer_set(attotime::from_msec(200), timer_expired_delegate(FUNC(cidelsa_state::set_cpu_mode),this)); | |
460 | 459 | } |
461 | 460 | |
462 | 461 | /* Machine Drivers */ |
r18112 | r18113 | |
---|---|---|
144 | 144 | machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
145 | 145 | } |
146 | 146 | |
147 | ||
147 | TIMER_CALLBACK_MEMBER(tehkanwc_state::reset_callback) | |
148 | 148 | { |
149 | machine.device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); | |
149 | machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); | |
150 | 150 | } |
151 | 151 | |
152 | 152 | WRITE8_MEMBER(tehkanwc_state::sound_answer_w) |
r18112 | r18113 | |
155 | 155 | |
156 | 156 | /* in Gridiron, the sound CPU goes in a tight loop after the self test, */ |
157 | 157 | /* probably waiting to be reset by a watchdog */ |
158 | if (space.device().safe_pc() == 0x08bc) machine().scheduler().timer_set(attotime::from_seconds(1), FUNC(reset_callback)); | |
158 | if (space.device().safe_pc() == 0x08bc) machine().scheduler().timer_set(attotime::from_seconds(1), timer_expired_delegate(FUNC(tehkanwc_state::reset_callback),this)); | |
159 | 159 | } |
160 | 160 | |
161 | 161 |
r18112 | r18113 | |
---|---|---|
484 | 484 | ***************************************************************************/ |
485 | 485 | |
486 | 486 | |
487 | ||
487 | TIMER_CALLBACK_MEMBER(toaplan2_state::toaplan2_raise_irq) | |
488 | 488 | { |
489 | toaplan2_state *state = machine.driver_data<toaplan2_state>(); | |
490 | 489 | |
491 | | |
490 | m_main_cpu->execute().set_input_line(param, HOLD_LINE); | |
492 | 491 | } |
493 | 492 | |
494 | 493 | static void toaplan2_vblank_irq(running_machine &machine, int irq_line) |
495 | 494 | { |
495 | toaplan2_state *state = machine.driver_data<toaplan2_state>(); | |
496 | 496 | // the IRQ appears to fire at line 0xe6 |
497 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0xe6), FUNC(toaplan2_raise_irq), irq_line); | |
497 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0xe6), timer_expired_delegate(FUNC(toaplan2_state::toaplan2_raise_irq),state), irq_line); | |
498 | 498 | } |
499 | 499 | |
500 | 500 | INTERRUPT_GEN_MEMBER(toaplan2_state::toaplan2_vblank_irq1){ toaplan2_vblank_irq(machine(), 1); } |
r18112 | r18113 | |
---|---|---|
61 | 61 | m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); |
62 | 62 | } |
63 | 63 | |
64 | ||
64 | TIMER_CALLBACK_MEMBER(rollerg_state::nmi_callback) | |
65 | 65 | { |
66 | rollerg_state *state = machine.driver_data<rollerg_state>(); | |
67 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
66 | m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); | |
68 | 67 | } |
69 | 68 | |
70 | 69 | WRITE8_MEMBER(rollerg_state::sound_arm_nmi_w) |
71 | 70 | { |
72 | 71 | m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); |
73 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(nmi_callback)); /* kludge until the K053260 is emulated correctly */ | |
72 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(rollerg_state::nmi_callback),this)); /* kludge until the K053260 is emulated correctly */ | |
74 | 73 | } |
75 | 74 | |
76 | 75 | READ8_MEMBER(rollerg_state::pip_r) |
r18112 | r18113 | |
---|---|---|
58 | 58 | m_LS74_q = 0; |
59 | 59 | } |
60 | 60 | |
61 | ||
61 | TIMER_CALLBACK_MEMBER(magmax_state::scanline_callback) | |
62 | 62 | { |
63 | magmax_state *state = machine.driver_data<magmax_state>(); | |
64 | 63 | int scanline = param; |
65 | 64 | |
66 | 65 | /* bit 0 goes hi whenever line V6 from video part goes lo->hi */ |
67 | 66 | /* that is when scanline is 64 and 192 accordingly */ |
68 | if (state->m_LS74_clr != 0) | |
69 | state->m_LS74_q = 1; | |
67 | if (m_LS74_clr != 0) | |
68 | m_LS74_q = 1; | |
70 | 69 | |
71 | 70 | scanline += 128; |
72 | 71 | scanline &= 255; |
73 | 72 | |
74 | | |
73 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
75 | 74 | } |
76 | 75 | |
77 | 76 | void magmax_state::machine_start() |
78 | 77 | { |
79 | 78 | /* Create interrupt timer */ |
80 | m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(scanline_callback)); | |
79 | m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(magmax_state::scanline_callback),this)); | |
81 | 80 | |
82 | 81 | /* Set up save state */ |
83 | 82 | state_save_register_global(machine(), m_sound_latch); |
r18112 | r18113 | |
---|---|---|
120 | 120 | * |
121 | 121 | *************************************/ |
122 | 122 | |
123 | ||
123 | TIMER_CALLBACK_MEMBER(mhavoc_state::delayed_gamma_w) | |
124 | 124 | { |
125 | mhavoc_state *state = machine.driver_data<mhavoc_state>(); | |
126 | 125 | /* mark the data received */ |
127 | state->m_gamma_rcvd = 0; | |
128 | state->m_alpha_xmtd = 1; | |
129 | state->m_alpha_data = param; | |
126 | m_gamma_rcvd = 0; | |
127 | m_alpha_xmtd = 1; | |
128 | m_alpha_data = param; | |
130 | 129 | |
131 | 130 | /* signal with an NMI pulse */ |
132 | machine.device("gamma")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
131 | machine().device("gamma")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
133 | 132 | |
134 | 133 | /* the sound CPU needs to reply in 250microseconds (according to Neil Bradley) */ |
135 | machine.scheduler().timer_set(attotime::from_usec(250), FUNC_NULL); | |
134 | machine().scheduler().timer_set(attotime::from_usec(250), FUNC_NULL); | |
136 | 135 | } |
137 | 136 | |
138 | 137 | |
139 | 138 | WRITE8_MEMBER(mhavoc_state::mhavoc_gamma_w) |
140 | 139 | { |
141 | 140 | logerror(" writing to gamma processor: %02x (%d %d)\n", data, m_gamma_rcvd, m_alpha_xmtd); |
142 | machine().scheduler().synchronize(FUNC(delayed_gamma_w), data); | |
141 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(mhavoc_state::delayed_gamma_w),this), data); | |
143 | 142 | } |
144 | 143 | |
145 | 144 |
r18112 | r18113 | |
---|---|---|
23 | 23 | return m_toz80; |
24 | 24 | } |
25 | 25 | |
26 | ||
26 | TIMER_CALLBACK_MEMBER(arkanoid_state::test) | |
27 | 27 | { |
28 | arkanoid_state *state = machine.driver_data<arkanoid_state>(); | |
29 | 28 | |
30 | state->m_z80write = 1; | |
31 | state->m_fromz80 = param; | |
29 | m_z80write = 1; | |
30 | m_fromz80 = param; | |
32 | 31 | } |
33 | 32 | |
34 | 33 | WRITE8_MEMBER(arkanoid_state::arkanoid_Z80_mcu_w) |
35 | 34 | { |
36 | machine().scheduler().synchronize(FUNC(test), data); | |
35 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(arkanoid_state::test),this), data); | |
37 | 36 | /* boost the interleave for a few usecs to make sure it is read successfully */ |
38 | 37 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); |
39 | 38 | } |
r18112 | r18113 | |
---|---|---|
258 | 258 | return result >> 14; |
259 | 259 | } |
260 | 260 | |
261 | ||
261 | TIMER_CALLBACK_MEMBER(micro3d_state::mac_done_callback) | |
262 | 262 | { |
263 | micro3d_state *state = machine.driver_data<micro3d_state>(); | |
264 | 263 | |
265 | machine.device("drmath")->execute().set_input_line(AM29000_INTR0, ASSERT_LINE); | |
266 | state->m_mac_stat = 0; | |
264 | machine().device("drmath")->execute().set_input_line(AM29000_INTR0, ASSERT_LINE); | |
265 | m_mac_stat = 0; | |
267 | 266 | } |
268 | 267 | |
269 | 268 | |
r18112 | r18113 | |
466 | 465 | |
467 | 466 | /* TODO: Calculate a better estimate for timing */ |
468 | 467 | if (m_mac_stat) |
469 | machine().scheduler().timer_set(attotime::from_hz(MAC_CLK) * mac_cycles, FUNC(mac_done_callback)); | |
468 | machine().scheduler().timer_set(attotime::from_hz(MAC_CLK) * mac_cycles, timer_expired_delegate(FUNC(micro3d_state::mac_done_callback),this)); | |
470 | 469 | |
471 | 470 | m_mrab11 = mrab11; |
472 | 471 | m_vtx_addr = vtx_addr; |
r18112 | r18113 | |
497 | 496 | return ((y_encoder & 0xff) << 8) | (x_encoder & 0xff); |
498 | 497 | } |
499 | 498 | |
500 | ||
499 | TIMER_CALLBACK_MEMBER(micro3d_state::adc_done_callback) | |
501 | 500 | { |
502 | micro3d_state *state = machine.driver_data<micro3d_state>(); | |
503 | 501 | |
504 | 502 | switch (param) |
505 | 503 | { |
506 | case 0: | |
504 | case 0: m_adc_val = ioport("THROTTLE")->read_safe(0); | |
507 | 505 | break; |
508 | case 1: | |
506 | case 1: m_adc_val = (UINT8)((255.0/100.0) * ioport("VOLUME")->read() + 0.5); | |
509 | 507 | break; |
510 | 508 | case 2: break; |
511 | 509 | case 3: break; |
512 | 510 | } |
513 | 511 | |
514 | // mc68901_int_gen(machine, GPIP3); | |
512 | // mc68901_int_gen(machine(), GPIP3); | |
515 | 513 | } |
516 | 514 | |
517 | 515 | READ16_MEMBER(micro3d_state::micro3d_adc_r) |
r18112 | r18113 | |
528 | 526 | return; |
529 | 527 | } |
530 | 528 | |
531 | machine().scheduler().timer_set(attotime::from_usec(40), FUNC(adc_done_callback), data & ~4); | |
529 | machine().scheduler().timer_set(attotime::from_usec(40), timer_expired_delegate(FUNC(micro3d_state::adc_done_callback),this), data & ~4); | |
532 | 530 | } |
533 | 531 | |
534 | 532 | CUSTOM_INPUT_MEMBER(micro3d_state::botss_hwchk_r) |
r18112 | r18113 | |
---|---|---|
8 | 8 | |
9 | 9 | ***************************************************************************/ |
10 | 10 | |
11 | ||
11 | TIMER_CALLBACK_MEMBER(lsasquad_state::nmi_callback) | |
12 | 12 | { |
13 | lsasquad_state *state = machine.driver_data<lsasquad_state>(); | |
14 | 13 | |
15 | if (state->m_sound_nmi_enable) | |
16 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
14 | if (m_sound_nmi_enable) | |
15 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
17 | 16 | else |
18 | | |
17 | m_pending_nmi = 1; | |
19 | 18 | } |
20 | 19 | |
21 | 20 | WRITE8_MEMBER(lsasquad_state::lsasquad_sh_nmi_disable_w) |
r18112 | r18113 | |
40 | 39 | m_sound_cmd = data; |
41 | 40 | |
42 | 41 | //logerror("%04x: sound cmd %02x\n", space.device().safe_pc(), data); |
43 | machine().scheduler().synchronize(FUNC(nmi_callback), data); | |
42 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(lsasquad_state::nmi_callback),this), data); | |
44 | 43 | } |
45 | 44 | |
46 | 45 | READ8_MEMBER(lsasquad_state::lsasquad_sh_sound_command_r) |
r18112 | r18113 | |
---|---|---|
268 | 268 | } |
269 | 269 | |
270 | 270 | |
271 | ||
271 | TIMER_CALLBACK_MEMBER(williams_state::williams_count240_off_callback) | |
272 | 272 | { |
273 | pia6821_device *pia_1 = machine.device<pia6821_device>("pia_1"); | |
273 | pia6821_device *pia_1 = machine().device<pia6821_device>("pia_1"); | |
274 | 274 | |
275 | 275 | /* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */ |
276 | 276 | pia_1->ca1_w(0); |
r18112 | r18113 | |
279 | 279 | |
280 | 280 | TIMER_DEVICE_CALLBACK( williams_count240_callback ) |
281 | 281 | { |
282 | williams_state *state = timer.machine().driver_data<williams_state>(); | |
282 | 283 | pia6821_device *pia_1 = timer.machine().device<pia6821_device>("pia_1"); |
283 | 284 | |
284 | 285 | /* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */ |
285 | 286 | pia_1->ca1_w(1); |
286 | 287 | |
287 | 288 | /* set a timer to turn it off once the scanline counter resets */ |
288 | timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(0), FUNC(williams_count240_off_callback)); | |
289 | timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(williams_state::williams_count240_off_callback),state)); | |
289 | 290 | |
290 | 291 | /* set a timer for next frame */ |
291 | 292 | timer.adjust(timer.machine().primary_screen->time_until_pos(240)); |
r18112 | r18113 | |
422 | 423 | } |
423 | 424 | |
424 | 425 | |
425 | ||
426 | TIMER_CALLBACK_MEMBER(williams_state::williams2_endscreen_off_callback) | |
426 | 427 | { |
427 | pia6821_device *pia_0 = machine.device<pia6821_device>("pia_0"); | |
428 | pia6821_device *pia_0 = machine().device<pia6821_device>("pia_0"); | |
428 | 429 | |
429 | 430 | /* the /ENDSCREEN signal comes into CA1 */ |
430 | 431 | pia_0->ca1_w(1); |
r18112 | r18113 | |
433 | 434 | |
434 | 435 | TIMER_DEVICE_CALLBACK( williams2_endscreen_callback ) |
435 | 436 | { |
437 | williams_state *state = timer.machine().driver_data<williams_state>(); | |
436 | 438 | pia6821_device *pia_0 = timer.machine().device<pia6821_device>("pia_0"); |
437 | 439 | |
438 | 440 | /* the /ENDSCREEN signal comes into CA1 */ |
439 | 441 | pia_0->ca1_w(0); |
440 | 442 | |
441 | 443 | /* set a timer to turn it off once the scanline counter resets */ |
442 | timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(8), FUNC(williams2_endscreen_off_callback)); | |
444 | timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(8), timer_expired_delegate(FUNC(williams_state::williams2_endscreen_off_callback),state)); | |
443 | 445 | |
444 | 446 | /* set a timer for next frame */ |
445 | 447 | timer.adjust(timer.machine().primary_screen->time_until_pos(254)); |
r18112 | r18113 | |
550 | 552 | * |
551 | 553 | *************************************/ |
552 | 554 | |
553 | ||
555 | TIMER_CALLBACK_MEMBER(williams_state::williams_deferred_snd_cmd_w) | |
554 | 556 | { |
555 | pia6821_device *pia_2 = machine.device<pia6821_device>("pia_2"); | |
557 | pia6821_device *pia_2 = machine().device<pia6821_device>("pia_2"); | |
556 | 558 | |
557 | 559 | pia_2->portb_w(param); |
558 | 560 | pia_2->cb1_w((param == 0xff) ? 0 : 1); |
r18112 | r18113 | |
560 | 562 | |
561 | 563 | WRITE8_DEVICE_HANDLER( williams_snd_cmd_w ) |
562 | 564 | { |
565 | williams_state *state = device->machine().driver_data<williams_state>(); | |
563 | 566 | /* the high two bits are set externally, and should be 1 */ |
564 | space.machine().scheduler().synchronize(FUNC(williams_deferred_snd_cmd_w), data | 0xc0); | |
567 | space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::williams_deferred_snd_cmd_w),state), data | 0xc0); | |
565 | 568 | } |
566 | 569 | |
567 | 570 | WRITE8_DEVICE_HANDLER( playball_snd_cmd_w ) |
568 | 571 | { |
569 | space.machine().scheduler().synchronize(FUNC(williams_deferred_snd_cmd_w), data); | |
572 | williams_state *state = device->machine().driver_data<williams_state>(); | |
573 | space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::williams_deferred_snd_cmd_w),state), data); | |
570 | 574 | } |
571 | 575 | |
572 | ||
576 | TIMER_CALLBACK_MEMBER(williams_state::blaster_deferred_snd_cmd_w) | |
573 | 577 | { |
574 | pia6821_device *pia_2l = machine.device<pia6821_device>("pia_2"); | |
575 | pia6821_device *pia_2r = machine.device<pia6821_device>("pia_2b"); | |
578 | pia6821_device *pia_2l = machine().device<pia6821_device>("pia_2"); | |
579 | pia6821_device *pia_2r = machine().device<pia6821_device>("pia_2b"); | |
576 | 580 | UINT8 l_data = param | 0x80; |
577 | 581 | UINT8 r_data = (param >> 1 & 0x40) | (param & 0x3f) | 0x80; |
578 | 582 | |
r18112 | r18113 | |
582 | 586 | |
583 | 587 | WRITE8_DEVICE_HANDLER( blaster_snd_cmd_w ) |
584 | 588 | { |
585 | space.machine().scheduler().synchronize(FUNC(blaster_deferred_snd_cmd_w), data); | |
589 | williams_state *state = device->machine().driver_data<williams_state>(); | |
590 | space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::blaster_deferred_snd_cmd_w),state), data); | |
586 | 591 | } |
587 | 592 | |
588 | 593 | |
589 | ||
594 | TIMER_CALLBACK_MEMBER(williams_state::williams2_deferred_snd_cmd_w) | |
590 | 595 | { |
591 | pia6821_device *pia_2 = machine.device<pia6821_device>("pia_2"); | |
596 | pia6821_device *pia_2 = machine().device<pia6821_device>("pia_2"); | |
592 | 597 | |
593 | 598 | pia_2->porta_w(param); |
594 | 599 | } |
595 | 600 | |
596 | 601 | static WRITE8_DEVICE_HANDLER( williams2_snd_cmd_w ) |
597 | 602 | { |
598 | space.machine().scheduler().synchronize(FUNC(williams2_deferred_snd_cmd_w), data); | |
603 | williams_state *state = device->machine().driver_data<williams_state>(); | |
604 | space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::williams2_deferred_snd_cmd_w),state), data); | |
599 | 605 | } |
600 | 606 | |
601 | 607 | |
r18112 | r18113 | |
991 | 997 | } |
992 | 998 | |
993 | 999 | |
994 | ||
1000 | TIMER_CALLBACK_MEMBER(joust2_state::joust2_deferred_snd_cmd_w) | |
995 | 1001 | { |
996 | pia6821_device *pia_2 = machine.device<pia6821_device>("pia_2"); | |
1002 | pia6821_device *pia_2 = machine().device<pia6821_device>("pia_2"); | |
997 | 1003 | pia_2->porta_w(param & 0xff); |
998 | 1004 | } |
999 | 1005 | |
r18112 | r18113 | |
1011 | 1017 | joust2_state *state = space.machine().driver_data<joust2_state>(); |
1012 | 1018 | state->m_joust2_current_sound_data = (state->m_joust2_current_sound_data & ~0xff) | (data & 0xff); |
1013 | 1019 | state->m_cvsd_sound->write(space.machine().driver_data()->generic_space(), 0, state->m_joust2_current_sound_data); |
1014 | space.machine().scheduler().synchronize(FUNC(joust2_deferred_snd_cmd_w), state->m_joust2_current_sound_data); | |
1020 | space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(joust2_state::joust2_deferred_snd_cmd_w),state), state->m_joust2_current_sound_data); | |
1015 | 1021 | } |
r18112 | r18113 | |
---|---|---|
76 | 76 | |
77 | 77 | #endif |
78 | 78 | |
79 | ||
79 | TIMER_CALLBACK_MEMBER(dc_state::aica_dma_irq) | |
80 | 80 | { |
81 | dc_state *state = machine.driver_data<dc_state>(); | |
82 | 81 | |
83 | state->m_wave_dma.start = state->g2bus_regs[SB_ADST] = 0; | |
84 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_AICA; | |
85 | dc_update_interrupt_status(machine); | |
82 | m_wave_dma.start = g2bus_regs[SB_ADST] = 0; | |
83 | dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_AICA; | |
84 | dc_update_interrupt_status(machine()); | |
86 | 85 | } |
87 | 86 | |
88 | ||
87 | TIMER_CALLBACK_MEMBER(dc_state::pvr_dma_irq) | |
89 | 88 | { |
90 | dc_state *state = machine.driver_data<dc_state>(); | |
91 | 89 | |
92 | state->m_pvr_dma.start = state->pvrctrl_regs[SB_PDST] = 0; | |
93 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_PVR; | |
94 | dc_update_interrupt_status(machine); | |
90 | m_pvr_dma.start = pvrctrl_regs[SB_PDST] = 0; | |
91 | dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_PVR; | |
92 | dc_update_interrupt_status(machine()); | |
95 | 93 | } |
96 | 94 | |
97 | 95 | void naomi_g1_irq(running_machine &machine) |
r18112 | r18113 | |
110 | 108 | dc_update_interrupt_status(machine); |
111 | 109 | } |
112 | 110 | |
113 | ||
111 | TIMER_CALLBACK_MEMBER(dc_state::ch2_dma_irq) | |
114 | 112 | { |
115 | dc_state *state = machine.driver_data<dc_state>(); | |
116 | 113 | |
117 | state->dc_sysctrl_regs[SB_C2DLEN]=0; | |
118 | state->dc_sysctrl_regs[SB_C2DST]=0; | |
119 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_CH2; | |
120 | dc_update_interrupt_status(machine); | |
114 | dc_sysctrl_regs[SB_C2DLEN]=0; | |
115 | dc_sysctrl_regs[SB_C2DST]=0; | |
116 | dc_sysctrl_regs[SB_ISTNRM] |= IST_DMA_CH2; | |
117 | dc_update_interrupt_status(machine()); | |
121 | 118 | } |
122 | 119 | |
123 | ||
120 | TIMER_CALLBACK_MEMBER(dc_state::yuv_fifo_irq) | |
124 | 121 | { |
125 | dc_state *state = machine.driver_data<dc_state>(); | |
126 | 122 | |
127 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_YUV; | |
128 | dc_update_interrupt_status(machine); | |
123 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_YUV; | |
124 | dc_update_interrupt_status(machine()); | |
129 | 125 | } |
130 | 126 | |
131 | 127 | static void wave_dma_execute(address_space &space) |
r18112 | r18113 | |
166 | 162 | state->m_wave_dma.flag = (state->m_wave_dma.indirect & 1) ? 1 : 0; |
167 | 163 | /* Note: if you trigger an instant DMA IRQ trigger, sfz3upper doesn't play any bgm. */ |
168 | 164 | /* TODO: timing of this */ |
169 | space.machine().scheduler().timer_set(attotime::from_usec(300), FUNC(aica_dma_irq)); | |
165 | space.machine().scheduler().timer_set(attotime::from_usec(300), timer_expired_delegate(FUNC(dc_state::aica_dma_irq),state)); | |
170 | 166 | } |
171 | 167 | |
172 | 168 | static void pvr_dma_execute(address_space &space) |
r18112 | r18113 | |
206 | 202 | } |
207 | 203 | /* Note: do not update the params, since this DMA type doesn't support it. */ |
208 | 204 | /* TODO: timing of this */ |
209 | space.machine().scheduler().timer_set(attotime::from_usec(250), FUNC(pvr_dma_irq)); | |
205 | space.machine().scheduler().timer_set(attotime::from_usec(250), timer_expired_delegate(FUNC(dc_state::pvr_dma_irq),state)); | |
210 | 206 | } |
211 | 207 | |
212 | 208 | // register decode helpers |
r18112 | r18113 | |
419 | 415 | state->dc_sysctrl_regs[SB_C2DSTAT]=address+ddtdata.length; |
420 | 416 | |
421 | 417 | /* 200 usecs breaks sfz3upper */ |
422 | space.machine().scheduler().timer_set(attotime::from_usec(50), FUNC(ch2_dma_irq)); | |
418 | space.machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(dc_state::ch2_dma_irq),state)); | |
423 | 419 | /* simulate YUV FIFO processing here */ |
424 | 420 | if((address & 0x1800000) == 0x0800000) |
425 | space.machine().scheduler().timer_set(attotime::from_usec(500), FUNC(yuv_fifo_irq)); | |
421 | space.machine().scheduler().timer_set(attotime::from_usec(500), timer_expired_delegate(FUNC(dc_state::yuv_fifo_irq),state)); | |
426 | 422 | } |
427 | 423 | break; |
428 | 424 | |
r18112 | r18113 | |
737 | 733 | mame_printf_verbose("RTC: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x710000 + reg*4, dat, data, offset, mem_mask); |
738 | 734 | } |
739 | 735 | |
740 | ||
736 | TIMER_CALLBACK_MEMBER(dc_state::dc_rtc_increment) | |
741 | 737 | { |
742 | dc_state *state = machine.driver_data<dc_state>(); | |
743 | 738 | |
744 | state->dc_rtcregister[RTC2] = (state->dc_rtcregister[RTC2] + 1) & 0xFFFF; | |
745 | if (state->dc_rtcregister[RTC2] == 0) | |
746 | state->dc_rtcregister[RTC1] = (state->dc_rtcregister[RTC1] + 1) & 0xFFFF; | |
739 | dc_rtcregister[RTC2] = (dc_rtcregister[RTC2] + 1) & 0xFFFF; | |
740 | if (dc_rtcregister[RTC2] == 0) | |
741 | dc_rtcregister[RTC1] = (dc_rtcregister[RTC1] + 1) & 0xFFFF; | |
747 | 742 | } |
748 | 743 | |
749 | 744 | /* fill the RTC registers with the proper start-up values */ |
r18112 | r18113 | |
784 | 779 | state->dc_rtcregister[RTC2] = current_time & 0x0000ffff; |
785 | 780 | state->dc_rtcregister[RTC1] = (current_time & 0xffff0000) >> 16; |
786 | 781 | |
787 | state->dc_rtc_timer = machine.scheduler().timer_alloc(FUNC(dc_rtc_increment)); | |
782 | state->dc_rtc_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(dc_state::dc_rtc_increment),state)); | |
788 | 783 | } |
789 | 784 | |
790 | 785 | void dc_state::machine_start() |
r18112 | r18113 | |
---|---|---|
35 | 35 | |
36 | 36 | |
37 | 37 | |
38 | ||
38 | TIMER_CALLBACK_MEMBER(starwars_state::math_run_clear) | |
39 | 39 | { |
40 | starwars_state *state = machine.driver_data<starwars_state>(); | |
41 | state->m_math_run = 0; | |
40 | m_math_run = 0; | |
42 | 41 | } |
43 | 42 | |
44 | 43 | |
r18112 | r18113 | |
174 | 173 | state->m_PROM_AM[cnt] = (val >> 7) & 0x0001; |
175 | 174 | } |
176 | 175 | |
177 | state->m_math_timer = machine.scheduler().timer_alloc(FUNC(math_run_clear)); | |
176 | state->m_math_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(starwars_state::math_run_clear),state)); | |
178 | 177 | } |
179 | 178 | |
180 | 179 |
r18112 | r18113 | |
---|---|---|
272 | 272 | |
273 | 273 | *********************************************************************/ |
274 | 274 | |
275 | ||
275 | TIMER_CALLBACK_MEMBER(vectrex_state::vectrex_imager_change_color) | |
276 | 276 | { |
277 | vectrex_state *state = machine.driver_data<vectrex_state>(); | |
278 | state->m_beam_color = param; | |
277 | m_beam_color = param; | |
279 | 278 | } |
280 | 279 | |
281 | 280 | |
282 | ||
281 | TIMER_CALLBACK_MEMBER(vectrex_state::update_level) | |
283 | 282 | { |
284 | 283 | if (ptr) |
285 | 284 | * (UINT8 *) ptr = param; |
286 | 285 | } |
287 | 286 | |
288 | 287 | |
289 | TIMER_CALLBACK(vectrex_imager_eye) | |
288 | TIMER_CALLBACK_MEMBER(vectrex_state::vectrex_imager_eye) | |
290 | 289 | { |
291 | vectrex_state *state = machine.driver_data<vectrex_state>(); | |
292 | via6522_device *via_0 = machine.device<via6522_device>("via6522_0"); | |
290 | via6522_device *via_0 = machine().device<via6522_device>("via6522_0"); | |
293 | 291 | int coffset; |
294 | double rtime = (1.0 / | |
292 | double rtime = (1.0 / m_imager_freq); | |
295 | 293 | |
296 | if ( | |
294 | if (m_imager_status > 0) | |
297 | 295 | { |
298 | | |
296 | m_imager_status = param; | |
299 | 297 | coffset = param > 1? 3: 0; |
300 | machine.scheduler().timer_set (attotime::from_double(rtime * state->m_imager_angles[0]), FUNC(vectrex_imager_change_color), state->m_imager_colors[coffset+2]); | |
301 | machine.scheduler().timer_set (attotime::from_double(rtime * state->m_imager_angles[1]), FUNC(vectrex_imager_change_color), state->m_imager_colors[coffset+1]); | |
302 | machine.scheduler().timer_set (attotime::from_double(rtime * state->m_imager_angles[2]), FUNC(vectrex_imager_change_color), state->m_imager_colors[coffset]); | |
298 | machine().scheduler().timer_set (attotime::from_double(rtime * m_imager_angles[0]), timer_expired_delegate(FUNC(vectrex_state::vectrex_imager_change_color),this), m_imager_colors[coffset+2]); | |
299 | machine().scheduler().timer_set (attotime::from_double(rtime * m_imager_angles[1]), timer_expired_delegate(FUNC(vectrex_state::vectrex_imager_change_color),this), m_imager_colors[coffset+1]); | |
300 | machine().scheduler().timer_set (attotime::from_double(rtime * m_imager_angles[2]), timer_expired_delegate(FUNC(vectrex_state::vectrex_imager_change_color),this), m_imager_colors[coffset]); | |
303 | 301 | |
304 | 302 | if (param == 2) |
305 | 303 | { |
306 | machine.scheduler().timer_set (attotime::from_double(rtime * 0.50), FUNC(vectrex_imager_eye), 1); | |
304 | machine().scheduler().timer_set (attotime::from_double(rtime * 0.50), timer_expired_delegate(FUNC(vectrex_state::vectrex_imager_eye),this), 1); | |
307 | 305 | |
308 | 306 | /* Index hole sensor is connected to IO7 which triggers also CA1 of VIA */ |
309 | 307 | via_0->write_ca1(1); |
310 | 308 | via_0->write_ca1(0); |
311 | state->m_imager_pinlevel |= 0x80; | |
312 | machine.scheduler().timer_set (attotime::from_double(rtime / 360.0), FUNC(update_level), 0, &state->m_imager_pinlevel); | |
309 | m_imager_pinlevel |= 0x80; | |
310 | machine().scheduler().timer_set (attotime::from_double(rtime / 360.0), timer_expired_delegate(FUNC(vectrex_state::update_level),this), 0, &m_imager_pinlevel); | |
313 | 311 | } |
314 | 312 | } |
315 | 313 | } |
r18112 | r18113 | |
---|---|---|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | ||
89 | TIMER_CALLBACK_MEMBER(bublbobl_state::nmi_callback) | |
90 | 90 | { |
91 | bublbobl_state *state = machine.driver_data<bublbobl_state>(); | |
92 | 91 | |
93 | if (state->m_sound_nmi_enable) | |
94 | state->m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
92 | if (m_sound_nmi_enable) | |
93 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); | |
95 | 94 | else |
96 | | |
95 | m_pending_nmi = 1; | |
97 | 96 | } |
98 | 97 | |
99 | 98 | WRITE8_MEMBER(bublbobl_state::bublbobl_sound_command_w) |
100 | 99 | { |
101 | 100 | soundlatch_byte_w(space, offset, data); |
102 | machine().scheduler().synchronize(FUNC(nmi_callback), data); | |
101 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(bublbobl_state::nmi_callback),this), data); | |
103 | 102 | } |
104 | 103 | |
105 | 104 | WRITE8_MEMBER(bublbobl_state::bublbobl_sh_nmi_disable_w) |
r18112 | r18113 | |
367 | 366 | The following is ENTIRELY GUESSWORK!!! |
368 | 367 | |
369 | 368 | ***************************************************************************/ |
370 | ||
369 | TIMER_CALLBACK_MEMBER(bublbobl_state::bublbobl_m68705_irq_ack) | |
371 | 370 | { |
372 | machine.device("mcu")->execute().set_input_line(0, CLEAR_LINE); | |
371 | machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); | |
373 | 372 | } |
374 | 373 | |
375 | 374 | INTERRUPT_GEN_MEMBER(bublbobl_state::bublbobl_m68705_interrupt) |
376 | 375 | { |
377 | 376 | device.execute().set_input_line(0, ASSERT_LINE); |
378 | 377 | |
379 | machine().scheduler().timer_set(attotime::from_msec(1000/60), FUNC(bublbobl_m68705_irq_ack)); /* TODO: understand how this is ack'ed */ | |
378 | machine().scheduler().timer_set(attotime::from_msec(1000/60), timer_expired_delegate(FUNC(bublbobl_state::bublbobl_m68705_irq_ack),this)); /* TODO: understand how this is ack'ed */ | |
380 | 379 | } |
381 | 380 | |
382 | 381 |
r18112 | r18113 | |
---|---|---|
19 | 19 | machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); |
20 | 20 | } |
21 | 21 | |
22 | ||
22 | TIMER_CALLBACK_MEMBER(pitnrun_state::pitnrun_mcu_real_data_r) | |
23 | 23 | { |
24 | pitnrun_state *state = machine.driver_data<pitnrun_state>(); | |
25 | state->m_zaccept = 1; | |
24 | m_zaccept = 1; | |
26 | 25 | } |
27 | 26 | |
28 | 27 | READ8_MEMBER(pitnrun_state::pitnrun_mcu_data_r) |
29 | 28 | { |
30 | machine().scheduler().synchronize(FUNC(pitnrun_mcu_real_data_r)); | |
29 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(pitnrun_state::pitnrun_mcu_real_data_r),this)); | |
31 | 30 | return m_toz80; |
32 | 31 | } |
33 | 32 | |
34 | ||
33 | TIMER_CALLBACK_MEMBER(pitnrun_state::pitnrun_mcu_real_data_w) | |
35 | 34 | { |
36 | pitnrun_state *state = machine.driver_data<pitnrun_state>(); | |
37 | state->m_zready = 1; | |
38 | machine.device("mcu")->execute().set_input_line(0, ASSERT_LINE); | |
39 | state->m_fromz80 = param; | |
35 | m_zready = 1; | |
36 | machine().device("mcu")->execute().set_input_line(0, ASSERT_LINE); | |
37 | m_fromz80 = param; | |
40 | 38 | } |
41 | 39 | |
42 | 40 | WRITE8_MEMBER(pitnrun_state::pitnrun_mcu_data_w) |
43 | 41 | { |
44 | machine().scheduler().synchronize(FUNC(pitnrun_mcu_real_data_w), data); | |
42 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(pitnrun_state::pitnrun_mcu_real_data_w),this), data); | |
45 | 43 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(5)); |
46 | 44 | } |
47 | 45 | |
r18112 | r18113 | |
90 | 88 | } |
91 | 89 | |
92 | 90 | |
93 | ||
91 | TIMER_CALLBACK_MEMBER(pitnrun_state::pitnrun_mcu_data_real_r) | |
94 | 92 | { |
95 | pitnrun_state *state = machine.driver_data<pitnrun_state>(); | |
96 | state->m_zready = 0; | |
93 | m_zready = 0; | |
97 | 94 | } |
98 | 95 | |
99 | ||
96 | TIMER_CALLBACK_MEMBER(pitnrun_state::pitnrun_mcu_status_real_w) | |
100 | 97 | { |
101 | pitnrun_state *state = machine.driver_data<pitnrun_state>(); | |
102 | state->m_toz80 = param; | |
103 | state->m_zaccept = 0; | |
98 | m_toz80 = param; | |
99 | m_zaccept = 0; | |
104 | 100 | } |
105 | 101 | |
106 | 102 | WRITE8_MEMBER(pitnrun_state::pitnrun_68705_portB_w) |
r18112 | r18113 | |
109 | 105 | if (~data & 0x02) |
110 | 106 | { |
111 | 107 | /* 68705 is going to read data from the Z80 */ |
112 | machine().scheduler().synchronize(FUNC(pitnrun_mcu_data_real_r)); | |
108 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(pitnrun_state::pitnrun_mcu_data_real_r),this)); | |
113 | 109 | machine().device("mcu")->execute().set_input_line(0,CLEAR_LINE); |
114 | 110 | m_portA_in = m_fromz80; |
115 | 111 | } |
116 | 112 | if (~data & 0x04) |
117 | 113 | { |
118 | 114 | /* 68705 is writing data for the Z80 */ |
119 | machine().scheduler().synchronize(FUNC(pitnrun_mcu_status_real_w), m_portA_out); | |
115 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(pitnrun_state::pitnrun_mcu_status_real_w),this), m_portA_out); | |
120 | 116 | } |
121 | 117 | if (~data & 0x10) |
122 | 118 | { |
r18112 | r18113 | |
---|---|---|
109 | 109 | * CPU 1 timed interrupt - 60Hz??? |
110 | 110 | */ |
111 | 111 | |
112 | ||
112 | TIMER_CALLBACK_MEMBER(stfight_state::stfight_interrupt_1) | |
113 | 113 | { |
114 | 114 | // Do a RST08 |
115 | machine.device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); | |
115 | machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf); | |
116 | 116 | } |
117 | 117 | |
118 | 118 | INTERRUPT_GEN_MEMBER(stfight_state::stfight_vb_interrupt) |
119 | 119 | { |
120 | 120 | // Do a RST10 |
121 | 121 | device.execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7); |
122 | machine().scheduler().timer_set(attotime::from_hz(120), FUNC(stfight_interrupt_1)); | |
122 | machine().scheduler().timer_set(attotime::from_hz(120), timer_expired_delegate(FUNC(stfight_state::stfight_interrupt_1),this)); | |
123 | 123 | } |
124 | 124 | |
125 | 125 | /* |
r18112 | r18113 | |
---|---|---|
28 | 28 | * |
29 | 29 | *************************************/ |
30 | 30 | |
31 | ||
31 | TIMER_CALLBACK_MEMBER(balsente_state::irq_off) | |
32 | 32 | { |
33 | machine.device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, CLEAR_LINE); | |
33 | machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, CLEAR_LINE); | |
34 | 34 | } |
35 | 35 | |
36 | 36 | |
r18112 | r18113 | |
48 | 48 | timer.machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE); |
49 | 49 | |
50 | 50 | /* it will turn off on the next HBLANK */ |
51 | timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(param, BALSENTE_HBSTART), FUNC(irq_off)); | |
51 | timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(param, BALSENTE_HBSTART), timer_expired_delegate(FUNC(balsente_state::irq_off),state)); | |
52 | 52 | |
53 | 53 | /* if this is Grudge Match, update the steering */ |
54 | 54 | if (state->m_grudge_steering_result & 0x80) |
r18112 | r18113 | |
456 | 456 | } |
457 | 457 | |
458 | 458 | |
459 | ||
459 | TIMER_CALLBACK_MEMBER(balsente_state::m6850_data_ready_callback) | |
460 | 460 | { |
461 | balsente_state *state = machine.driver_data<balsente_state>(); | |
462 | 461 | |
463 | 462 | /* set the output data byte and indicate that we're ready to go */ |
464 | state->m_m6850_output = param; | |
465 | state->m_m6850_data_ready = 1; | |
466 | m6850_update_io(machine); | |
463 | m_m6850_output = param; | |
464 | m_m6850_data_ready = 1; | |
465 | m6850_update_io(machine()); | |
467 | 466 | } |
468 | 467 | |
469 | 468 | |
470 | ||
469 | TIMER_CALLBACK_MEMBER(balsente_state::m6850_w_callback) | |
471 | 470 | { |
472 | balsente_state *state = machine.driver_data<balsente_state>(); | |
473 | 471 | |
474 | 472 | /* indicate that the transmit buffer is no longer empty and update the I/O state */ |
475 | state->m_m6850_status &= ~0x02; | |
476 | m6850_update_io(machine); | |
473 | m_m6850_status &= ~0x02; | |
474 | m6850_update_io(machine()); | |
477 | 475 | |
478 | 476 | /* set a timer for 500usec later to actually transmit the data */ |
479 | 477 | /* (this is very important for several games, esp Snacks'n Jaxson) */ |
480 | machine.scheduler().timer_set(attotime::from_usec(500), FUNC(m6850_data_ready_callback), param); | |
478 | machine().scheduler().timer_set(attotime::from_usec(500), timer_expired_delegate(FUNC(balsente_state::m6850_data_ready_callback),this), param); | |
481 | 479 | } |
482 | 480 | |
483 | 481 | |
r18112 | r18113 | |
495 | 493 | |
496 | 494 | /* output register is at offset 1; set a timer to synchronize the CPUs */ |
497 | 495 | else |
498 | machine().scheduler().synchronize(FUNC(m6850_w_callback), data); | |
496 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(balsente_state::m6850_w_callback),this), data); | |
499 | 497 | } |
500 | 498 | |
501 | 499 | |
r18112 | r18113 | |
570 | 568 | } |
571 | 569 | |
572 | 570 | |
573 | ||
571 | TIMER_CALLBACK_MEMBER(balsente_state::adc_finished) | |
574 | 572 | { |
575 | balsente_state *state = machine.driver_data<balsente_state>(); | |
576 | 573 | int which = param; |
577 | 574 | |
578 | 575 | /* analog controls are read in two pieces; the lower port returns the sign */ |
579 | 576 | /* and the upper port returns the absolute value of the magnitude */ |
580 | int val = | |
577 | int val = m_analog_input_data[which / 2] << m_adc_shift; | |
581 | 578 | |
582 | 579 | /* special case for Stompin'/Shrike Avenger */ |
583 | if ( | |
580 | if (m_adc_shift == 32) | |
584 | 581 | { |
585 | | |
582 | m_adc_value = m_analog_input_data[which]; | |
586 | 583 | return; |
587 | 584 | } |
588 | 585 | |
r18112 | r18113 | |
597 | 594 | |
598 | 595 | /* return the sign */ |
599 | 596 | if (!(which & 1)) |
600 | | |
597 | m_adc_value = (val < 0) ? 0xff : 0x00; | |
601 | 598 | |
602 | 599 | /* return the magnitude */ |
603 | 600 | else |
604 | | |
601 | m_adc_value = (val < 0) ? -val : val; | |
605 | 602 | } |
606 | 603 | |
607 | 604 | |
r18112 | r18113 | |
618 | 615 | /* set a timer to go off and read the value after 50us */ |
619 | 616 | /* it's important that we do this for Mini Golf */ |
620 | 617 | logerror("adc_select %d\n", offset & 7); |
621 | machine().scheduler().timer_set(attotime::from_usec(50), FUNC(adc_finished), offset & 7); | |
618 | machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(balsente_state::adc_finished),this), offset & 7); | |
622 | 619 | } |
623 | 620 | |
624 | 621 |
r18112 | r18113 | |
---|---|---|
101 | 101 | |
102 | 102 | *************************************/ |
103 | 103 | |
104 | ||
104 | TIMER_CALLBACK_MEMBER(snes_state::snes_nmi_tick) | |
105 | 105 | { |
106 | snes_state *state = machine.driver_data<snes_state>(); | |
107 | 106 | |
108 | 107 | // pull NMI |
109 | | |
108 | m_maincpu->set_input_line(G65816_LINE_NMI, ASSERT_LINE); | |
110 | 109 | |
111 | 110 | // don't happen again |
112 | | |
111 | m_nmi_timer->adjust(attotime::never); | |
113 | 112 | } |
114 | 113 | |
115 | 114 | static void snes_hirq_tick( running_machine &machine ) |
r18112 | r18113 | |
126 | 125 | state->m_hirq_timer->adjust(attotime::never); |
127 | 126 | } |
128 | 127 | |
129 | ||
128 | TIMER_CALLBACK_MEMBER(snes_state::snes_hirq_tick_callback) | |
130 | 129 | { |
131 | snes_hirq_tick(machine); | |
130 | snes_hirq_tick(machine()); | |
132 | 131 | } |
133 | 132 | |
134 | ||
133 | TIMER_CALLBACK_MEMBER(snes_state::snes_reset_oam_address) | |
135 | 134 | { |
136 | snes_state *state = machine.driver_data<snes_state>(); | |
137 | 135 | // make sure we're in the 65816's context since we're messing with the OAM and stuff |
138 | address_space &space = | |
136 | address_space &space = m_maincpu->space(AS_PROGRAM); | |
139 | 137 | |
140 | 138 | if (!(snes_ppu.screen_disabled)) //Reset OAM address, byuu says it happens at H=10 |
141 | 139 | { |
r18112 | r18113 | |
145 | 143 | } |
146 | 144 | } |
147 | 145 | |
148 | ||
146 | TIMER_CALLBACK_MEMBER(snes_state::snes_reset_hdma) | |
149 | 147 | { |
150 | snes_state *state = machine.driver_data<snes_state>(); | |
151 | address_space &cpu0space = state->m_maincpu->space(AS_PROGRAM); | |
148 | address_space &cpu0space = m_maincpu->space(AS_PROGRAM); | |
152 | 149 | snes_hdma_init(cpu0space); |
153 | 150 | } |
154 | 151 | |
155 | ||
152 | TIMER_CALLBACK_MEMBER(snes_state::snes_update_io) | |
156 | 153 | { |
157 | snes_state *state = machine.driver_data<snes_state>(); | |
158 | address_space &cpu0space = state->m_maincpu->space(AS_PROGRAM); | |
159 | state->m_io_read(cpu0space.machine()); | |
154 | address_space &cpu0space = m_maincpu->space(AS_PROGRAM); | |
155 | m_io_read(cpu0space.machine()); | |
160 | 156 | snes_ram[HVBJOY] &= 0xfe; /* Clear busy bit */ |
161 | 157 | |
162 | | |
158 | m_io_timer->adjust(attotime::never); | |
163 | 159 | } |
164 | 160 | |
165 | ||
161 | TIMER_CALLBACK_MEMBER(snes_state::snes_scanline_tick) | |
166 | 162 | { |
167 | snes_state *state = machine.driver_data<snes_state>(); | |
168 | 163 | |
169 | 164 | /* Increase current line - we want to latch on this line during it, not after it */ |
170 | snes_ppu.beam.current_vert = machine.primary_screen->vpos(); | |
165 | snes_ppu.beam.current_vert = machine().primary_screen->vpos(); | |
171 | 166 | |
172 | 167 | // not in hblank |
173 | 168 | snes_ram[HVBJOY] &= ~0x40; |
r18112 | r18113 | |
175 | 170 | /* Vertical IRQ timer - only if horizontal isn't also enabled! */ |
176 | 171 | if ((snes_ram[NMITIMEN] & 0x20) && !(snes_ram[NMITIMEN] & 0x10)) |
177 | 172 | { |
178 | if (snes_ppu.beam.current_vert == | |
173 | if (snes_ppu.beam.current_vert == m_vtime) | |
179 | 174 | { |
180 | 175 | snes_ram[TIMEUP] = 0x80; /* Indicate that irq occurred */ |
181 | 176 | // IRQ latches the counters, do it now |
182 | snes_latch_counters(machine); | |
183 | state->m_maincpu->set_input_line(G65816_LINE_IRQ, ASSERT_LINE ); | |
177 | snes_latch_counters(machine()); | |
178 | m_maincpu->set_input_line(G65816_LINE_IRQ, ASSERT_LINE ); | |
184 | 179 | } |
185 | 180 | } |
186 | 181 | /* Horizontal IRQ timer */ |
187 | 182 | if (snes_ram[NMITIMEN] & 0x10) |
188 | 183 | { |
189 | 184 | int setirq = 1; |
190 | int pixel = | |
185 | int pixel = m_htime; | |
191 | 186 | |
192 | 187 | // is the HIRQ on a specific scanline? |
193 | 188 | if (snes_ram[NMITIMEN] & 0x20) |
194 | 189 | { |
195 | if (snes_ppu.beam.current_vert != | |
190 | if (snes_ppu.beam.current_vert != m_vtime) | |
196 | 191 | { |
197 | 192 | setirq = 0; |
198 | 193 | } |
r18112 | r18113 | |
200 | 195 | |
201 | 196 | if (setirq) |
202 | 197 | { |
203 | // printf("HIRQ @ %d, %d\n", pixel * | |
198 | // printf("HIRQ @ %d, %d\n", pixel * m_htmult, snes_ppu.beam.current_vert); | |
204 | 199 | if (pixel == 0) |
205 | 200 | { |
206 | snes_hirq_tick(machine); | |
201 | snes_hirq_tick(machine()); | |
207 | 202 | } |
208 | 203 | else |
209 | 204 | { |
210 | | |
205 | m_hirq_timer->adjust(machine().primary_screen->time_until_pos(snes_ppu.beam.current_vert, pixel * m_htmult)); | |
211 | 206 | } |
212 | 207 | } |
213 | 208 | } |
r18112 | r18113 | |
215 | 210 | /* Start of VBlank */ |
216 | 211 | if (snes_ppu.beam.current_vert == snes_ppu.beam.last_visible_line) |
217 | 212 | { |
218 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(snes_ppu.beam.current_vert, 10), FUNC(snes_reset_oam_address)); | |
213 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(snes_ppu.beam.current_vert, 10), timer_expired_delegate(FUNC(snes_state::snes_reset_oam_address),this)); | |
219 | 214 | |
220 | 215 | snes_ram[HVBJOY] |= 0x81; /* Set vblank bit to on & indicate controllers being read */ |
221 | 216 | snes_ram[RDNMI] |= 0x80; /* Set NMI occurred bit */ |
r18112 | r18113 | |
223 | 218 | if (snes_ram[NMITIMEN] & 0x80) /* NMI only signaled if this bit set */ |
224 | 219 | { |
225 | 220 | // NMI goes off about 12 cycles after this (otherwise Chrono Trigger, NFL QB Club, etc. lock up) |
226 | | |
221 | m_nmi_timer->adjust(m_maincpu->cycles_to_attotime(12)); | |
227 | 222 | } |
228 | 223 | |
229 | 224 | /* three lines after start of vblank we update the controllers (value from snes9x) */ |
230 | | |
225 | m_io_timer->adjust(machine().primary_screen->time_until_pos(snes_ppu.beam.current_vert + 2, m_hblank_offset * m_htmult)); | |
231 | 226 | } |
232 | 227 | |
233 | 228 | // hdma reset happens at scanline 0, H=~6 |
234 | 229 | if (snes_ppu.beam.current_vert == 0) |
235 | 230 | { |
236 | address_space &cpu0space = | |
231 | address_space &cpu0space = m_maincpu->space(AS_PROGRAM); | |
237 | 232 | snes_hdma_init(cpu0space); |
238 | 233 | } |
239 | 234 | |
r18112 | r18113 | |
244 | 239 | snes_ram[STAT78] ^= 0x80; /* Toggle field flag */ |
245 | 240 | snes_ppu.stat77_flags &= 0x3f; /* Clear Time Over and Range Over bits */ |
246 | 241 | |
247 | | |
242 | m_maincpu->set_input_line(G65816_LINE_NMI, CLEAR_LINE ); | |
248 | 243 | } |
249 | 244 | |
250 | state->m_scanline_timer->adjust(attotime::never); | |
251 | state->m_hblank_timer->adjust(machine.primary_screen->time_until_pos(snes_ppu.beam.current_vert, state->m_hblank_offset * state->m_htmult)); | |
245 | m_scanline_timer->adjust(attotime::never); | |
246 | m_hblank_timer->adjust(machine().primary_screen->time_until_pos(snes_ppu.beam.current_vert, m_hblank_offset * m_htmult)); | |
252 | 247 | |
253 | 248 | // printf("%02x %d\n",snes_ram[HVBJOY],snes_ppu.beam.current_vert); |
254 | 249 | } |
255 | 250 | |
256 | 251 | /* This is called at the start of hblank *before* the scanline indicated in current_vert! */ |
257 | ||
252 | TIMER_CALLBACK_MEMBER(snes_state::snes_hblank_tick) | |
258 | 253 | { |
259 | snes_state *state = machine.driver_data<snes_state>(); | |
260 | address_space &cpu0space = state->m_maincpu->space(AS_PROGRAM); | |
254 | address_space &cpu0space = m_maincpu->space(AS_PROGRAM); | |
261 | 255 | int nextscan; |
262 | 256 | |
263 | snes_ppu.beam.current_vert = machine.primary_screen->vpos(); | |
257 | snes_ppu.beam.current_vert = machine().primary_screen->vpos(); | |
264 | 258 | |
265 | 259 | /* make sure we halt */ |
266 | | |
260 | m_hblank_timer->adjust(attotime::never); | |
267 | 261 | |
268 | 262 | /* draw a scanline */ |
269 | 263 | if (snes_ppu.beam.current_vert <= snes_ppu.beam.last_visible_line) |
270 | 264 | { |
271 | if (machine.primary_screen->vpos() > 0) | |
265 | if (machine().primary_screen->vpos() > 0) | |
272 | 266 | { |
273 | 267 | /* Do HDMA */ |
274 | 268 | if (snes_ram[HDMAEN]) |
275 | 269 | snes_hdma(cpu0space); |
276 | 270 | |
277 | machine.primary_screen->update_partial((snes_ppu.interlace == 2) ? (snes_ppu.beam.current_vert * snes_ppu.interlace) : snes_ppu.beam.current_vert - 1); | |
271 | machine().primary_screen->update_partial((snes_ppu.interlace == 2) ? (snes_ppu.beam.current_vert * snes_ppu.interlace) : snes_ppu.beam.current_vert - 1); | |
278 | 272 | } |
279 | 273 | } |
280 | 274 | |
r18112 | r18113 | |
288 | 282 | nextscan = 0; |
289 | 283 | } |
290 | 284 | |
291 | | |
285 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(nextscan)); | |
292 | 286 | } |
293 | 287 | |
294 | 288 | |
r18112 | r18113 | |
723 | 717 | break; |
724 | 718 | case HDMAEN: /* HDMA channel designation */ |
725 | 719 | if (data) //if a HDMA is enabled, data is inited at the next scanline |
726 | space.machine().scheduler().timer_set(space.machine().primary_screen->time_until_pos(snes_ppu.beam.current_vert + 1), FUNC(snes_reset_hdma)); | |
720 | space.machine().scheduler().timer_set(space.machine().primary_screen->time_until_pos(snes_ppu.beam.current_vert + 1), timer_expired_delegate(FUNC(snes_state::snes_reset_hdma),state)); | |
727 | 721 | break; |
728 | 722 | case TIMEUP: // IRQ Flag is cleared on both read and write |
729 | 723 | state->m_maincpu->set_input_line(G65816_LINE_IRQ, CLEAR_LINE ); |
r18112 | r18113 | |
1534 | 1528 | snes_state *state = machine.driver_data<snes_state>(); |
1535 | 1529 | |
1536 | 1530 | /* init timers and stop them */ |
1537 | state->m_scanline_timer = machine.scheduler().timer_alloc(FUNC(snes_scanline_tick)); | |
1531 | state->m_scanline_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(snes_state::snes_scanline_tick),state)); | |
1538 | 1532 | state->m_scanline_timer->adjust(attotime::never); |
1539 | state->m_hblank_timer = machine.scheduler().timer_alloc(FUNC(snes_hblank_tick)); | |
1533 | state->m_hblank_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(snes_state::snes_hblank_tick),state)); | |
1540 | 1534 | state->m_hblank_timer->adjust(attotime::never); |
1541 | state->m_nmi_timer = machine.scheduler().timer_alloc(FUNC(snes_nmi_tick)); | |
1535 | state->m_nmi_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(snes_state::snes_nmi_tick),state)); | |
1542 | 1536 | state->m_nmi_timer->adjust(attotime::never); |
1543 | state->m_hirq_timer = machine.scheduler().timer_alloc(FUNC(snes_hirq_tick_callback)); | |
1537 | state->m_hirq_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(snes_state::snes_hirq_tick_callback),state)); | |
1544 | 1538 | state->m_hirq_timer->adjust(attotime::never); |
1545 | 1539 | //state->m_div_timer = machine.scheduler().timer_alloc(FUNC(snes_div_callback)); |
1546 | 1540 | //state->m_div_timer->adjust(attotime::never); |
1547 | 1541 | //state->m_mult_timer = machine.scheduler().timer_alloc(FUNC(snes_mult_callback)); |
1548 | 1542 | //state->m_mult_timer->adjust(attotime::never); |
1549 | state->m_io_timer = machine.scheduler().timer_alloc(FUNC(snes_update_io)); | |
1543 | state->m_io_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(snes_state::snes_update_io),state)); | |
1550 | 1544 | state->m_io_timer->adjust(attotime::never); |
1551 | 1545 | |
1552 | 1546 | // SNES hcounter has a 0-339 range. hblank starts at counter 260. |
r18112 | r18113 | |
---|---|---|
150 | 150 | set_led_status(machine(), 1,data & 0x20); |
151 | 151 | } |
152 | 152 | |
153 | ||
153 | TIMER_CALLBACK_MEMBER(irobot_state::scanline_callback) | |
154 | 154 | { |
155 | irobot_state *state = machine.driver_data<irobot_state>(); | |
156 | 155 | int scanline = param; |
157 | 156 | |
158 | if (scanline == 0) state->m_irvg_vblank=0; | |
159 | if (scanline == 224) state->m_irvg_vblank=1; | |
157 | if (scanline == 0) m_irvg_vblank=0; | |
158 | if (scanline == 224) m_irvg_vblank=1; | |
160 | 159 | logerror("SCANLINE CALLBACK %d\n",scanline); |
161 | 160 | /* set the IRQ line state based on the 32V line state */ |
162 | machine.device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE); | |
161 | machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, (scanline & 32) ? ASSERT_LINE : CLEAR_LINE); | |
163 | 162 | |
164 | 163 | /* set a callback for the next 32-scanline increment */ |
165 | 164 | scanline += 32; |
166 | 165 | if (scanline >= 256) scanline = 0; |
167 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(scanline_callback), scanline); | |
166 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(irobot_state::scanline_callback),this), scanline); | |
168 | 167 | } |
169 | 168 | |
170 | 169 | void irobot_state::machine_reset() |
r18112 | r18113 | |
184 | 183 | m_irmb_timer = machine().device<timer_device>("irmb_timer"); |
185 | 184 | |
186 | 185 | /* set an initial timer to go off on scanline 0 */ |
187 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), FUNC(scanline_callback)); | |
186 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(irobot_state::scanline_callback),this)); | |
188 | 187 | |
189 | 188 | irobot_rom_banksel_w(machine().device("maincpu")->memory().space(AS_PROGRAM),0,0); |
190 | 189 | irobot_out0_w(machine().device("maincpu")->memory().space(AS_PROGRAM),0,0); |
r18112 | r18113 | |
---|---|---|
33 | 33 | |
34 | 34 | |
35 | 35 | /* Internal routines */ |
36 | static TIMER_CALLBACK( leland_interrupt_callback ); | |
37 | static TIMER_CALLBACK( ataxx_interrupt_callback ); | |
38 | 36 | |
39 | 37 | |
40 | 38 | |
39 | ||
40 | ||
41 | 41 | /************************************* |
42 | 42 | * |
43 | 43 | * Generic dial encoding |
r18112 | r18113 | |
322 | 322 | m_battery_ram = reinterpret_cast<UINT8 *>(memshare("battery")->ptr()); |
323 | 323 | |
324 | 324 | /* start scanline interrupts going */ |
325 | m_master_int_timer = machine().scheduler().timer_alloc(FUNC(leland_interrupt_callback)); | |
325 | m_master_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(leland_state::leland_interrupt_callback),this)); | |
326 | 326 | } |
327 | 327 | |
328 | 328 | |
r18112 | r18113 | |
372 | 372 | m_extra_tram = auto_alloc_array(machine(), UINT8, ATAXX_EXTRA_TRAM_SIZE); |
373 | 373 | |
374 | 374 | /* start scanline interrupts going */ |
375 | m_master_int_timer = machine().scheduler().timer_alloc(FUNC(ataxx_interrupt_callback)); | |
375 | m_master_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(leland_state::ataxx_interrupt_callback),this)); | |
376 | 376 | } |
377 | 377 | |
378 | 378 | |
r18112 | r18113 | |
416 | 416 | * |
417 | 417 | *************************************/ |
418 | 418 | |
419 | ||
419 | TIMER_CALLBACK_MEMBER(leland_state::leland_interrupt_callback) | |
420 | 420 | { |
421 | leland_state *state = machine.driver_data<leland_state>(); | |
422 | 421 | int scanline = param; |
423 | 422 | |
424 | 423 | /* interrupts generated on the VA10 line, which is every */ |
425 | 424 | /* 16 scanlines starting with scanline #8 */ |
426 | machine.device("master")->execute().set_input_line(0, HOLD_LINE); | |
425 | machine().device("master")->execute().set_input_line(0, HOLD_LINE); | |
427 | 426 | |
428 | 427 | /* set a timer for the next one */ |
429 | 428 | scanline += 16; |
430 | 429 | if (scanline > 248) |
431 | 430 | scanline = 8; |
432 | | |
431 | m_master_int_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
433 | 432 | } |
434 | 433 | |
435 | 434 | |
436 | ||
435 | TIMER_CALLBACK_MEMBER(leland_state::ataxx_interrupt_callback) | |
437 | 436 | { |
438 | leland_state *state = machine.driver_data<leland_state>(); | |
439 | 437 | int scanline = param; |
440 | 438 | |
441 | 439 | /* interrupts generated according to the interrupt control register */ |
442 | machine.device("master")->execute().set_input_line(0, HOLD_LINE); | |
440 | machine().device("master")->execute().set_input_line(0, HOLD_LINE); | |
443 | 441 | |
444 | 442 | /* set a timer for the next one */ |
445 | | |
443 | m_master_int_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
446 | 444 | } |
447 | 445 | |
448 | 446 |
r18112 | r18113 | |
---|---|---|
731 | 731 | state->m_CRAM[1][0x154] = cchip_goalin[n][5]; |
732 | 732 | } |
733 | 733 | |
734 | ||
734 | TIMER_CALLBACK_MEMBER(rbisland_state::cchip_timer) | |
735 | 735 | { |
736 | rbisland_state *state = machine.driver_data<rbisland_state>(); | |
737 | 736 | |
738 | if ( | |
737 | if (m_CRAM[1][0x100] == 1) | |
739 | 738 | { |
740 | request_round_data(machine); | |
739 | request_round_data(machine()); | |
741 | 740 | |
742 | | |
741 | m_CRAM[1][0x100] = 0xFF; | |
743 | 742 | } |
744 | 743 | |
745 | if ( | |
744 | if (m_CRAM[5][0x000] == 1) | |
746 | 745 | { |
747 | request_world_data(machine); | |
746 | request_world_data(machine()); | |
748 | 747 | |
749 | | |
748 | m_CRAM[5][0x000] = 0xFF; | |
750 | 749 | } |
751 | 750 | |
752 | if ( | |
751 | if (m_CRAM[1][0x149] == 1) | |
753 | 752 | { |
754 | request_goalin_data(machine); | |
753 | request_goalin_data(machine()); | |
755 | 754 | |
756 | | |
755 | m_CRAM[1][0x149] = 0xFF; | |
757 | 756 | } |
758 | 757 | |
759 | coin_lockout_w(machine, 1, state->m_CRAM[0][8] & 0x80); | |
760 | coin_lockout_w(machine, 0, state->m_CRAM[0][8] & 0x40); | |
761 | coin_counter_w(machine, 1, state->m_CRAM[0][8] & 0x20); | |
762 | coin_counter_w(machine, 0, state->m_CRAM[0][8] & 0x10); | |
758 | coin_lockout_w(machine(), 1, m_CRAM[0][8] & 0x80); | |
759 | coin_lockout_w(machine(), 0, m_CRAM[0][8] & 0x40); | |
760 | coin_counter_w(machine(), 1, m_CRAM[0][8] & 0x20); | |
761 | coin_counter_w(machine(), 0, m_CRAM[0][8] & 0x10); | |
763 | 762 | |
764 | state->m_CRAM[0][3] = machine.root_device().ioport("800007")->read(); /* STARTn + SERVICE1 */ | |
765 | state->m_CRAM[0][4] = machine.root_device().ioport("800009")->read(); /* COINn */ | |
766 | state->m_CRAM[0][5] = machine.root_device().ioport("80000B")->read(); /* Player controls + TILT */ | |
767 | state->m_CRAM[0][6] = machine.root_device().ioport("80000D")->read(); /* Player controls (cocktail) */ | |
763 | m_CRAM[0][3] = machine().root_device().ioport("800007")->read(); /* STARTn + SERVICE1 */ | |
764 | m_CRAM[0][4] = machine().root_device().ioport("800009")->read(); /* COINn */ | |
765 | m_CRAM[0][5] = machine().root_device().ioport("80000B")->read(); /* Player controls + TILT */ | |
766 | m_CRAM[0][6] = machine().root_device().ioport("80000D")->read(); /* Player controls (cocktail) */ | |
768 | 767 | } |
769 | 768 | |
770 | 769 | /************************************* |
r18112 | r18113 | |
830 | 829 | |
831 | 830 | state_save_register_item(machine, "cchip", NULL, 0, state->m_current_bank); |
832 | 831 | |
833 | machine.scheduler().timer_pulse(attotime::from_hz(60), FUNC(cchip_timer)); | |
832 | machine.scheduler().timer_pulse(attotime::from_hz(60), timer_expired_delegate(FUNC(rbisland_state::cchip_timer),state)); | |
834 | 833 | } |
r18112 | r18113 | |
---|---|---|
632 | 632 | * |
633 | 633 | *************************************/ |
634 | 634 | |
635 | ||
635 | TIMER_CALLBACK_MEMBER(harddriv_state::deferred_adsp_bank_switch) | |
636 | 636 | { |
637 | harddriv_state *state = machine.driver_data<harddriv_state>(); | |
638 | if (LOG_COMMANDS && state->m_m68k_adsp_buffer_bank != param && machine.input().code_pressed(KEYCODE_L)) | |
637 | if (LOG_COMMANDS && m_m68k_adsp_buffer_bank != param && machine().input().code_pressed(KEYCODE_L)) | |
639 | 638 | { |
640 | 639 | static FILE *commands; |
641 | 640 | if (!commands) commands = fopen("commands.log", "w"); |
642 | 641 | if (commands) |
643 | 642 | { |
644 | INT16 *base = (INT16 *)& | |
643 | INT16 *base = (INT16 *)&m_som_memory[param * 0x2000]; | |
645 | 644 | INT16 *end = base + (UINT16)*base; |
646 | 645 | INT16 *current = base + 1; |
647 | 646 | INT16 *table = base + 1 + (UINT16)*current++; |
r18112 | r18113 | |
679 | 678 | } |
680 | 679 | } |
681 | 680 | |
682 | | |
681 | m_m68k_adsp_buffer_bank = param; | |
683 | 682 | logerror("ADSP bank = %d\n", param); |
684 | 683 | } |
685 | 684 | |
r18112 | r18113 | |
702 | 701 | |
703 | 702 | case 3: |
704 | 703 | logerror("ADSP bank = %d (deferred)\n", val); |
705 | space.machine().scheduler().synchronize(FUNC(deferred_adsp_bank_switch), val); | |
704 | space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(harddriv_state::deferred_adsp_bank_switch),state), val); | |
706 | 705 | break; |
707 | 706 | |
708 | 707 | case 5: |
r18112 | r18113 | |
1308 | 1307 | * |
1309 | 1308 | *************************************/ |
1310 | 1309 | |
1311 | ||
1310 | TIMER_CALLBACK_MEMBER(harddriv_state::rddsp32_sync_cb) | |
1312 | 1311 | { |
1313 | harddriv_state *state = machine.driver_data<harddriv_state>(); | |
1314 | *state->m_dataptr[param] = state->m_dataval[param]; | |
1312 | *m_dataptr[param] = m_dataval[param]; | |
1315 | 1313 | } |
1316 | 1314 | |
1317 | 1315 | |
r18112 | r18113 | |
1325 | 1323 | COMBINE_DATA(&newdata); |
1326 | 1324 | state->m_dataptr[state->m_next_msp_sync % MAX_MSP_SYNC] = dptr; |
1327 | 1325 | state->m_dataval[state->m_next_msp_sync % MAX_MSP_SYNC] = newdata; |
1328 | space.machine().scheduler().synchronize(FUNC(rddsp32_sync_cb), state->m_next_msp_sync++ % MAX_MSP_SYNC); | |
1326 | space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(harddriv_state::rddsp32_sync_cb),state), state->m_next_msp_sync++ % MAX_MSP_SYNC); | |
1329 | 1327 | } |
1330 | 1328 | else |
1331 | 1329 | COMBINE_DATA(&state->m_rddsp32_sync[0][offset]); |
r18112 | r18113 | |
1342 | 1340 | COMBINE_DATA(&newdata); |
1343 | 1341 | state->m_dataptr[state->m_next_msp_sync % MAX_MSP_SYNC] = dptr; |
1344 | 1342 | state->m_dataval[state->m_next_msp_sync % MAX_MSP_SYNC] = newdata; |
1345 | space.machine().scheduler().synchronize(FUNC(rddsp32_sync_cb), state->m_next_msp_sync++ % MAX_MSP_SYNC); | |
1343 | space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(harddriv_state::rddsp32_sync_cb),state), state->m_next_msp_sync++ % MAX_MSP_SYNC); | |
1346 | 1344 | } |
1347 | 1345 | else |
1348 | 1346 | COMBINE_DATA(&state->m_rddsp32_sync[1][offset]); |
r18112 | r18113 | |
---|---|---|
140 | 140 | |
141 | 141 | static void custom_reset(running_machine &machine); |
142 | 142 | static void autoconfig_reset(running_machine &machine); |
143 | static TIMER_CALLBACK( amiga_irq_proc ); | |
144 | static TIMER_CALLBACK( amiga_blitter_proc ); | |
145 | static TIMER_CALLBACK( scanline_callback ); | |
146 | 143 | |
147 | 144 | |
148 | 145 | |
146 | ||
147 | ||
148 | ||
149 | 149 | /************************************* |
150 | 150 | * |
151 | 151 | * Chipmem 16/32 bit access |
r18112 | r18113 | |
251 | 251 | } |
252 | 252 | |
253 | 253 | /* setup the timers */ |
254 | state->m_irq_timer = machine.scheduler().timer_alloc(FUNC(amiga_irq_proc)); | |
255 | state->m_blitter_timer = machine.scheduler().timer_alloc(FUNC(amiga_blitter_proc)); | |
254 | state->m_irq_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(amiga_state::amiga_irq_proc),state)); | |
255 | state->m_blitter_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(amiga_state::amiga_blitter_proc),state)); | |
256 | 256 | |
257 | 257 | state->m_sound_device = machine.device("amiga"); |
258 | 258 | } |
r18112 | r18113 | |
296 | 296 | (*m_intf->reset_callback)(machine()); |
297 | 297 | |
298 | 298 | /* start the scanline timer */ |
299 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), FUNC(scanline_callback)); | |
299 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(amiga_state::scanline_callback),this)); | |
300 | 300 | } |
301 | 301 | |
302 | 302 | |
r18112 | r18113 | |
307 | 307 | * |
308 | 308 | *************************************/ |
309 | 309 | |
310 | ||
310 | TIMER_CALLBACK_MEMBER(amiga_state::scanline_callback) | |
311 | 311 | { |
312 | ||
312 | ||
313 | 313 | int scanline = param; |
314 | device_t *cia_0 = machine.device("cia_0"); | |
315 | device_t *cia_1 = machine.device("cia_1"); | |
314 | device_t *cia_0 = machine().device("cia_0"); | |
315 | device_t *cia_1 = machine().device("cia_1"); | |
316 | 316 | |
317 | 317 | /* on the first scanline, we do some extra bookkeeping */ |
318 | 318 | if (scanline == 0) |
319 | 319 | { |
320 | 320 | /* signal VBLANK IRQ */ |
321 | amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_VERTB, 0xffff); | |
321 | amiga_custom_w(machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_VERTB, 0xffff); | |
322 | 322 | |
323 | 323 | /* clock the first CIA TOD */ |
324 | 324 | mos6526_tod_w(cia_0, 1); |
325 | 325 | |
326 | 326 | /* call the system-specific callback */ |
327 | if (state->m_intf->scanline0_callback != NULL) | |
328 | (*state->m_intf->scanline0_callback)(machine); | |
327 | if (m_intf->scanline0_callback != NULL) | |
328 | (*m_intf->scanline0_callback)(machine()); | |
329 | 329 | } |
330 | 330 | |
331 | 331 | /* on every scanline, clock the second CIA TOD */ |
332 | 332 | mos6526_tod_w(cia_1, 1); |
333 | 333 | |
334 | 334 | /* render up to this scanline */ |
335 | if (!machine.primary_screen->update_partial(scanline)) | |
335 | if (!machine().primary_screen->update_partial(scanline)) | |
336 | 336 | { |
337 | if (IS_AGA( | |
337 | if (IS_AGA(m_intf)) | |
338 | 338 | { |
339 | 339 | bitmap_rgb32 dummy_bitmap; |
340 | amiga_aga_render_scanline(machine, dummy_bitmap, scanline); | |
340 | amiga_aga_render_scanline(machine(), dummy_bitmap, scanline); | |
341 | 341 | } |
342 | 342 | else |
343 | 343 | { |
344 | 344 | bitmap_ind16 dummy_bitmap; |
345 | amiga_render_scanline(machine, dummy_bitmap, scanline); | |
345 | amiga_render_scanline(machine(), dummy_bitmap, scanline); | |
346 | 346 | } |
347 | 347 | } |
348 | 348 | |
349 | 349 | /* force a sound update */ |
350 | amiga_audio_update( | |
350 | amiga_audio_update(m_sound_device); | |
351 | 351 | |
352 | 352 | /* set timer for next line */ |
353 | scanline = (scanline + 1) % machine.primary_screen->height(); | |
354 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(scanline_callback), scanline); | |
353 | scanline = (scanline + 1) % machine().primary_screen->height(); | |
354 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(amiga_state::scanline_callback),this), scanline); | |
355 | 355 | } |
356 | 356 | |
357 | 357 | |
r18112 | r18113 | |
400 | 400 | } |
401 | 401 | |
402 | 402 | |
403 | ||
403 | TIMER_CALLBACK_MEMBER(amiga_state::amiga_irq_proc) | |
404 | 404 | { |
405 | amiga_state *state = machine.driver_data<amiga_state>(); | |
406 | 405 | |
407 | update_irqs(machine); | |
408 | state->m_irq_timer->reset( ); | |
406 | update_irqs(machine()); | |
407 | m_irq_timer->reset( ); | |
409 | 408 | } |
410 | 409 | |
411 | 410 | |
r18112 | r18113 | |
891 | 890 | * |
892 | 891 | *************************************/ |
893 | 892 | |
894 | ||
893 | TIMER_CALLBACK_MEMBER(amiga_state::amiga_blitter_proc) | |
895 | 894 | { |
896 | amiga_state *state = machine.driver_data<amiga_state>(); | |
895 | amiga_state *state = machine().driver_data<amiga_state>(); | |
897 | 896 | UINT32 blitsum = 0; |
898 | 897 | |
899 | 898 | /* logging */ |
r18112 | r18113 | |
918 | 917 | switch (CUSTOM_REG(REG_BLTCON1) & 0x0003) |
919 | 918 | { |
920 | 919 | case 0: /* ascending */ |
921 | blitsum = blit_ascending( | |
920 | blitsum = blit_ascending(this); | |
922 | 921 | break; |
923 | 922 | |
924 | 923 | case 2: /* descending */ |
925 | blitsum = blit_descending( | |
924 | blitsum = blit_descending(this); | |
926 | 925 | break; |
927 | 926 | |
928 | 927 | case 1: /* line */ |
929 | 928 | case 3: |
930 | blitsum = blit_line( | |
929 | blitsum = blit_line(this); | |
931 | 930 | break; |
932 | 931 | } |
933 | 932 | |
r18112 | r18113 | |
939 | 938 | CUSTOM_REG(REG_DMACON) &= ~0x4000; |
940 | 939 | |
941 | 940 | /* signal an interrupt */ |
942 | amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_BLIT, 0xffff); | |
941 | amiga_custom_w(machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_BLIT, 0xffff); | |
943 | 942 | |
944 | 943 | /* reset the blitter timer */ |
945 | | |
944 | m_blitter_timer->reset( ); | |
946 | 945 | } |
947 | 946 | |
948 | 947 | |
r18112 | r18113 | |
1241 | 1240 | * |
1242 | 1241 | *************************************/ |
1243 | 1242 | |
1244 | ||
1243 | TIMER_CALLBACK_MEMBER(amiga_state::finish_serial_write) | |
1245 | 1244 | { |
1246 | amiga_state *state = machine.driver_data<amiga_state>(); | |
1245 | amiga_state *state = machine().driver_data<amiga_state>(); | |
1247 | 1246 | |
1248 | 1247 | /* mark the transfer buffer empty */ |
1249 | 1248 | CUSTOM_REG(REG_SERDATR) |= 0x3000; |
1250 | 1249 | |
1251 | 1250 | /* signal an interrupt */ |
1252 | amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_TBE, 0xffff); | |
1251 | amiga_custom_w(machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_TBE, 0xffff); | |
1253 | 1252 | } |
1254 | 1253 | |
1255 | 1254 | |
r18112 | r18113 | |
1298 | 1297 | if (state->m_intf->serdat_w != NULL) |
1299 | 1298 | (*state->m_intf->serdat_w)(space.machine(), data); |
1300 | 1299 | CUSTOM_REG(REG_SERDATR) &= ~0x3000; |
1301 | space.machine().scheduler().timer_set(amiga_get_serial_char_period(space.machine()), FUNC(finish_serial_write)); | |
1300 | space.machine().scheduler().timer_set(amiga_get_serial_char_period(space.machine()), timer_expired_delegate(FUNC(amiga_state::finish_serial_write),state)); | |
1302 | 1301 | break; |
1303 | 1302 | |
1304 | 1303 | case REG_BLTSIZE: |
r18112 | r18113 | |
---|---|---|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | ||
45 | TIMER_CALLBACK_MEMBER(mw8080bw_state::mw8080bw_interrupt_callback) | |
46 | 46 | { |
47 | mw8080bw_state *state = machine.driver_data<mw8080bw_state>(); | |
48 | 47 | UINT8 next_counter; |
49 | 48 | int next_vpos; |
50 | 49 | int next_vblank; |
51 | 50 | |
52 | 51 | /* compute vector and set the interrupt line */ |
53 | int vpos = machine.primary_screen->vpos(); | |
52 | int vpos = machine().primary_screen->vpos(); | |
54 | 53 | UINT8 counter = vpos_to_vysnc_chain_counter(vpos); |
55 | 54 | UINT8 vector = 0xc7 | ((counter & 0x40) >> 2) | ((~counter & 0x40) >> 3); |
56 | | |
55 | m_maincpu->set_input_line_and_vector(0, HOLD_LINE, vector); | |
57 | 56 | |
58 | 57 | /* set up for next interrupt */ |
59 | 58 | if (counter == MW8080BW_INT_TRIGGER_COUNT_1) |
r18112 | r18113 | |
68 | 67 | } |
69 | 68 | |
70 | 69 | next_vpos = vysnc_chain_counter_to_vpos(next_counter, next_vblank); |
71 | | |
70 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(next_vpos)); | |
72 | 71 | } |
73 | 72 | |
74 | 73 | |
75 | 74 | static void mw8080bw_create_interrupt_timer( running_machine &machine ) |
76 | 75 | { |
77 | 76 | mw8080bw_state *state = machine.driver_data<mw8080bw_state>(); |
78 | state->m_interrupt_timer = machine.scheduler().timer_alloc(FUNC(mw8080bw_interrupt_callback)); | |
77 | state->m_interrupt_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(mw8080bw_state::mw8080bw_interrupt_callback),state)); | |
79 | 78 | } |
80 | 79 | |
81 | 80 |
r18112 | r18113 | |
---|---|---|
495 | 495 | *********************************/ |
496 | 496 | |
497 | 497 | /* |
498 | ||
498 | TIMER_CALLBACK_MEMBER(tnzs_state::kludge_callback) | |
499 | 499 | { |
500 | 500 | tnzs_sharedram[0x0f10] = param; |
501 | 501 | } |
502 | 502 | |
503 | 503 | WRITE8_MEMBER(tnzs_state::tnzs_sync_kludge_w) |
504 | 504 | { |
505 | machine().scheduler().synchronize(FUNC(kludge_callback), data); | |
505 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(tnzs_state::kludge_callback),this), data); | |
506 | 506 | } |
507 | 507 | */ |
508 | 508 |
r18112 | r18113 | |
---|---|---|
21 | 21 | |
22 | 22 | static void subtract_from_counter(running_machine &machine, int counter, int count); |
23 | 23 | |
24 | static TIMER_CALLBACK( mcr68_493_callback ); | |
25 | static TIMER_CALLBACK( zwackery_493_callback ); | |
26 | 24 | |
25 | ||
26 | ||
27 | 27 | static DECLARE_WRITE8_DEVICE_HANDLER( zwackery_pia0_w ); |
28 | 28 | static DECLARE_WRITE8_DEVICE_HANDLER( zwackery_pia1_w ); |
29 | 29 | static WRITE_LINE_DEVICE_HANDLER( zwackery_ca2_w ); |
30 | 30 | static WRITE_LINE_DEVICE_HANDLER( zwackery_pia_irq ); |
31 | 31 | |
32 | static TIMER_CALLBACK( counter_fired_callback ); | |
33 | 32 | |
34 | 33 | |
35 | 34 | |
35 | ||
36 | 36 | /************************************* |
37 | 37 | * |
38 | 38 | * 6821 PIA declarations |
r18112 | r18113 | |
125 | 125 | { |
126 | 126 | struct counter_state *m6840 = &m_m6840_state[i]; |
127 | 127 | |
128 | m6840->timer = machine().scheduler().timer_alloc(FUNC(counter_fired_callback)); | |
128 | m6840->timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mcr68_state::counter_fired_callback),this)); | |
129 | 129 | |
130 | 130 | state_save_register_item(machine(), "m6840", NULL, i, m6840->control); |
131 | 131 | state_save_register_item(machine(), "m6840", NULL, i, m6840->latch); |
r18112 | r18113 | |
177 | 177 | { |
178 | 178 | /* for the most part all MCR/68k games are the same */ |
179 | 179 | mcr68_common_init(machine()); |
180 | m_v493_callback = mcr68_493_callback; | |
181 | m_v493_callback_name = "mcr68_493_callback"; | |
180 | m_v493_callback = timer_expired_delegate(FUNC(mcr68_state::mcr68_493_callback),this); | |
182 | 181 | |
183 | 182 | /* vectors are 1 and 2 */ |
184 | 183 | m_v493_irq_vector = 1; |
r18112 | r18113 | |
196 | 195 | { |
197 | 196 | /* for the most part all MCR/68k games are the same */ |
198 | 197 | mcr68_common_init(machine()); |
199 | m_v493_callback = zwackery_493_callback; | |
200 | m_v493_callback_name = "zwackery_493_callback"; | |
198 | m_v493_callback = timer_expired_delegate(FUNC(mcr68_state::zwackery_493_callback),this); | |
201 | 199 | |
202 | 200 | /* vectors are 5 and 6 */ |
203 | 201 | m_v493_irq_vector = 5; |
r18112 | r18113 | |
223 | 221 | /* also set a timer to generate the 493 signal at a specific time before the next VBLANK */ |
224 | 222 | /* the timing of this is crucial for Blasted and Tri-Sports, which check the timing of */ |
225 | 223 | /* VBLANK and 493 using counter 2 */ |
226 | machine().scheduler().timer_set(attotime::from_hz(30) - m_timing_factor, m_v493_callback | |
224 | machine().scheduler().timer_set(attotime::from_hz(30) - m_timing_factor, m_v493_callback); | |
227 | 225 | } |
228 | 226 | |
229 | 227 | |
r18112 | r18113 | |
242 | 240 | } |
243 | 241 | |
244 | 242 | |
245 | ||
243 | TIMER_CALLBACK_MEMBER(mcr68_state::mcr68_493_off_callback) | |
246 | 244 | { |
247 | mcr68_state *state = machine.driver_data<mcr68_state>(); | |
248 | state->m_v493_irq_state = 0; | |
249 | update_mcr68_interrupts(machine); | |
245 | m_v493_irq_state = 0; | |
246 | update_mcr68_interrupts(machine()); | |
250 | 247 | } |
251 | 248 | |
252 | 249 | |
253 | ||
250 | TIMER_CALLBACK_MEMBER(mcr68_state::mcr68_493_callback) | |
254 | 251 | { |
255 | mcr68_state *state = machine.driver_data<mcr68_state>(); | |
256 | state->m_v493_irq_state = 1; | |
257 | update_mcr68_interrupts(machine); | |
258 | machine.scheduler().timer_set(machine.primary_screen->scan_period(), FUNC(mcr68_493_off_callback)); | |
252 | m_v493_irq_state = 1; | |
253 | update_mcr68_interrupts(machine()); | |
254 | machine().scheduler().timer_set(machine().primary_screen->scan_period(), timer_expired_delegate(FUNC(mcr68_state::mcr68_493_off_callback),this)); | |
259 | 255 | logerror("--- (INT1) ---\n"); |
260 | 256 | } |
261 | 257 | |
r18112 | r18113 | |
302 | 298 | } |
303 | 299 | |
304 | 300 | |
305 | ||
301 | TIMER_CALLBACK_MEMBER(mcr68_state::zwackery_493_off_callback) | |
306 | 302 | { |
307 | pia6821_device *pia = machine.device<pia6821_device>("pia0"); | |
303 | pia6821_device *pia = machine().device<pia6821_device>("pia0"); | |
308 | 304 | pia->ca1_w(0); |
309 | 305 | } |
310 | 306 | |
311 | 307 | |
312 | ||
308 | TIMER_CALLBACK_MEMBER(mcr68_state::zwackery_493_callback) | |
313 | 309 | { |
314 | pia6821_device *pia = machine.device<pia6821_device>("pia0"); | |
310 | pia6821_device *pia = machine().device<pia6821_device>("pia0"); | |
315 | 311 | |
316 | 312 | pia->ca1_w(1); |
317 | machine.scheduler().timer_set(machine.primary_screen->scan_period(), FUNC(zwackery_493_off_callback)); | |
313 | machine().scheduler().timer_set(machine().primary_screen->scan_period(), timer_expired_delegate(FUNC(mcr68_state::zwackery_493_off_callback),this)); | |
318 | 314 | } |
319 | 315 | |
320 | 316 | |
r18112 | r18113 | |
402 | 398 | } |
403 | 399 | |
404 | 400 | |
405 | ||
401 | TIMER_CALLBACK_MEMBER(mcr68_state::counter_fired_callback) | |
406 | 402 | { |
407 | mcr68_state *state = machine.driver_data<mcr68_state>(); | |
408 | 403 | int count = param >> 2; |
409 | 404 | int counter = param & 3; |
410 | struct counter_state *m6840 = & | |
405 | struct counter_state *m6840 = &m_m6840_state[counter]; | |
411 | 406 | |
412 | 407 | /* reset the timer */ |
413 | 408 | m6840->timer_active = 0; |
414 | 409 | |
415 | 410 | /* subtract it all from the counter; this will generate an interrupt */ |
416 | subtract_from_counter(machine, counter, count); | |
411 | subtract_from_counter(machine(), counter, count); | |
417 | 412 | } |
418 | 413 | |
419 | 414 |
r18112 | r18113 | |
---|---|---|
16 | 16 | // device type definition |
17 | 17 | const device_type N64PERIPH = &device_creator<n64_periphs>; |
18 | 18 | |
19 | static TIMER_CALLBACK(ai_timer_callback); | |
20 | static TIMER_CALLBACK(pi_dma_callback); | |
21 | static TIMER_CALLBACK(vi_scanline_callback); | |
22 | 19 | |
20 | ||
21 | ||
22 | ||
23 | 23 | n64_periphs::n64_periphs(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
24 | 24 | : device_t(mconfig, N64PERIPH, "N64 Periphal Chips", tag, owner, clock) |
25 | 25 | , m_nvram_image(NULL) |
26 | 26 | { |
27 | 27 | } |
28 | 28 | |
29 | ||
29 | TIMER_CALLBACK_MEMBER(n64_periphs::reset_timer_callback) | |
30 | 30 | { |
31 | n64_periphs *periphs = machine.device<n64_periphs>("rcp"); | |
32 | periphs->reset_tick(); | |
31 | reset_tick(); | |
33 | 32 | } |
34 | 33 | |
35 | 34 | void n64_periphs::reset_tick() |
r18112 | r18113 | |
63 | 62 | |
64 | 63 | void n64_periphs::device_start() |
65 | 64 | { |
66 | ai_timer = machine().scheduler().timer_alloc(FUNC(ai_timer_callback)); | |
67 | pi_dma_timer = machine().scheduler().timer_alloc(FUNC(pi_dma_callback)); | |
68 | vi_scanline_timer = machine().scheduler().timer_alloc(FUNC(vi_scanline_callback)); | |
69 | reset_timer = machine().scheduler().timer_alloc(FUNC(reset_timer_callback)); | |
65 | ai_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(n64_periphs::ai_timer_callback),this)); | |
66 | pi_dma_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(n64_periphs::pi_dma_callback),this)); | |
67 | vi_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(n64_periphs::vi_scanline_callback),this)); | |
68 | reset_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(n64_periphs::reset_timer_callback),this)); | |
70 | 69 | } |
71 | 70 | |
72 | 71 | void n64_periphs::device_reset() |
r18112 | r18113 | |
999 | 998 | sp_set_status |
1000 | 999 | }; |
1001 | 1000 | |
1002 | ||
1001 | TIMER_CALLBACK_MEMBER(n64_periphs::vi_scanline_callback) | |
1003 | 1002 | { |
1004 | machine.device<n64_periphs>("rcp")->vi_scanline_tick(); | |
1003 | machine().device<n64_periphs>("rcp")->vi_scanline_tick(); | |
1005 | 1004 | } |
1006 | 1005 | |
1007 | 1006 | void n64_periphs::vi_scanline_tick() |
r18112 | r18113 | |
1304 | 1303 | ai_timer->adjust(period); |
1305 | 1304 | } |
1306 | 1305 | |
1307 | ||
1306 | TIMER_CALLBACK_MEMBER(n64_periphs::ai_timer_callback) | |
1308 | 1307 | { |
1309 | machine.device<n64_periphs>("rcp")->ai_timer_tick(); | |
1308 | machine().device<n64_periphs>("rcp")->ai_timer_tick(); | |
1310 | 1309 | } |
1311 | 1310 | |
1312 | 1311 | void n64_periphs::ai_timer_tick() |
r18112 | r18113 | |
1404 | 1403 | |
1405 | 1404 | // Peripheral Interface |
1406 | 1405 | |
1407 | ||
1406 | TIMER_CALLBACK_MEMBER(n64_periphs::pi_dma_callback) | |
1408 | 1407 | { |
1409 | machine.device<n64_periphs>("rcp")->pi_dma_tick(); | |
1410 | machine.device("rsp")->execute().yield(); | |
1408 | machine().device<n64_periphs>("rcp")->pi_dma_tick(); | |
1409 | machine().device("rsp")->execute().yield(); | |
1411 | 1410 | } |
1412 | 1411 | |
1413 | 1412 | void n64_periphs::pi_dma_tick() |
r18112 | r18113 | |
---|---|---|
278 | 278 | }; |
279 | 279 | |
280 | 280 | |
281 | ||
281 | TIMER_CALLBACK_MEMBER(volfied_state::volfied_timer_callback) | |
282 | 282 | { |
283 | volfied_state *state = machine.driver_data<volfied_state>(); | |
284 | 283 | |
285 | 284 | // Palette commands - palette data written to bank 0: $10 - $af |
286 | if ( | |
285 | if (m_current_cmd >= 0x1 && m_current_cmd < 0x12) | |
287 | 286 | { |
288 | const UINT16* palette_data = palette_data_lookup[ | |
287 | const UINT16* palette_data = palette_data_lookup[m_current_cmd]; | |
289 | 288 | int i; |
290 | 289 | for (i = 0; i < 0x50; i++) |
291 | 290 | { |
292 | state->m_cchip_ram[0x10 + i * 2 + 0] = palette_data[i] >> 8; | |
293 | state->m_cchip_ram[0x10 + i * 2 + 1] = palette_data[i] & 0xff; | |
291 | m_cchip_ram[0x10 + i * 2 + 0] = palette_data[i] >> 8; | |
292 | m_cchip_ram[0x10 + i * 2 + 1] = palette_data[i] & 0xff; | |
294 | 293 | } |
295 | 294 | } |
296 | 295 | |
297 | 296 | // Unknown command - result written to bank 0: $23 |
298 | if ( | |
297 | if (m_current_cmd >= 0x81 && m_current_cmd < 0x92) | |
299 | 298 | { |
300 | switch ( | |
299 | switch (m_current_cmd) | |
301 | 300 | { |
302 | case 0x81: state->m_cchip_ram[0x23] = 0xf; break; | |
303 | case 0x82: state->m_cchip_ram[0x23] = 0x1; break; | |
304 | case 0x83: state->m_cchip_ram[0x23] = 0x6; break; | |
305 | case 0x84: state->m_cchip_ram[0x23] = 0xf; break; | |
306 | case 0x85: state->m_cchip_ram[0x23] = 0x9; break; | |
307 | case 0x86: state->m_cchip_ram[0x23] = 0x6; break; | |
308 | case 0x87: state->m_cchip_ram[0x23] = 0x6; break; | |
309 | case 0x88: state->m_cchip_ram[0x23] = 0xf; break; | |
310 | case 0x89: state->m_cchip_ram[0x23] = 0x8; break; | |
311 | case 0x8a: state->m_cchip_ram[0x23] = 0x1; break; | |
312 | case 0x8b: state->m_cchip_ram[0x23] = 0xa; break; | |
313 | case 0x8c: state->m_cchip_ram[0x23] = 0x1; break; | |
314 | case 0x8d: state->m_cchip_ram[0x23] = 0x1; break; | |
315 | case 0x8e: state->m_cchip_ram[0x23] = 0x8; break; | |
316 | case 0x8f: state->m_cchip_ram[0x23] = 0x6; break; | |
317 | case 0x90: state->m_cchip_ram[0x23] = 0xa; break; | |
318 | case 0x91: state->m_cchip_ram[0x23] = 0x0; break; | |
301 | case 0x81: m_cchip_ram[0x23] = 0xf; break; | |
302 | case 0x82: m_cchip_ram[0x23] = 0x1; break; | |
303 | case 0x83: m_cchip_ram[0x23] = 0x6; break; | |
304 | case 0x84: m_cchip_ram[0x23] = 0xf; break; | |
305 | case 0x85: m_cchip_ram[0x23] = 0x9; break; | |
306 | case 0x86: m_cchip_ram[0x23] = 0x6; break; | |
307 | case 0x87: m_cchip_ram[0x23] = 0x6; break; | |
308 | case 0x88: m_cchip_ram[0x23] = 0xf; break; | |
309 | case 0x89: m_cchip_ram[0x23] = 0x8; break; | |
310 | case 0x8a: m_cchip_ram[0x23] = 0x1; break; | |
311 | case 0x8b: m_cchip_ram[0x23] = 0xa; break; | |
312 | case 0x8c: m_cchip_ram[0x23] = 0x1; break; | |
313 | case 0x8d: m_cchip_ram[0x23] = 0x1; break; | |
314 | case 0x8e: m_cchip_ram[0x23] = 0x8; break; | |
315 | case 0x8f: m_cchip_ram[0x23] = 0x6; break; | |
316 | case 0x90: m_cchip_ram[0x23] = 0xa; break; | |
317 | case 0x91: m_cchip_ram[0x23] = 0x0; break; | |
319 | 318 | } |
320 | 319 | } |
321 | 320 | |
322 | | |
321 | m_current_cmd = 0; | |
323 | 322 | } |
324 | 323 | |
325 | 324 | /************************************* |
r18112 | r18113 | |
390 | 389 | // Palette request cmd - verified to take around 122242 68000 cycles to complete |
391 | 390 | if (m_current_cmd >= 0x1 && m_current_cmd < 0x12) |
392 | 391 | { |
393 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(122242), FUNC(volfied_timer_callback)); | |
392 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(122242), timer_expired_delegate(FUNC(volfied_state::volfied_timer_callback),this)); | |
394 | 393 | } |
395 | 394 | // Unknown cmd - verified to take around 105500 68000 cycles to complete |
396 | 395 | else if (m_current_cmd >= 0x81 && m_current_cmd < 0x92) |
397 | 396 | { |
398 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(105500), FUNC(volfied_timer_callback)); | |
397 | machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(105500), timer_expired_delegate(FUNC(volfied_state::volfied_timer_callback),this)); | |
399 | 398 | } |
400 | 399 | else |
401 | 400 | { |
r18112 | r18113 | |
---|---|---|
462 | 462 | * |
463 | 463 | *************************************/ |
464 | 464 | |
465 | ||
465 | TIMER_CALLBACK_MEMBER(qix_state::pia_w_callback) | |
466 | 466 | { |
467 | 467 | pia6821_device *device = (pia6821_device *)ptr; |
468 | 468 | device->write(device->machine().driver_data()->generic_space(), param >> 8, param & 0xff); |
r18112 | r18113 | |
471 | 471 | |
472 | 472 | WRITE8_DEVICE_HANDLER( qix_pia_w ) |
473 | 473 | { |
474 | qix_state *state = device->machine().driver_data<qix_state>(); | |
474 | 475 | /* make all the CPUs synchronize, and only AFTER that write the command to the PIA */ |
475 | 476 | /* otherwise the 68705 will miss commands */ |
476 | space.machine().scheduler().synchronize(FUNC(pia_w_callback), data | (offset << 8), (void *)downcast<pia6821_device *>(device)); | |
477 | space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(qix_state::pia_w_callback),state), data | (offset << 8), (void *)downcast<pia6821_device *>(device)); | |
477 | 478 | } |
478 | 479 | |
479 | 480 |
r18112 | r18113 | |
---|---|---|
102 | 102 | } |
103 | 103 | |
104 | 104 | /* timer callback : */ |
105 | ||
105 | TIMER_CALLBACK_MEMBER(taitosj_state::taitosj_mcu_real_data_w) | |
106 | 106 | { |
107 | taitosj_state *state = machine.driver_data<taitosj_state>(); | |
108 | state->m_zready = 1; | |
109 | machine.device("mcu")->execute().set_input_line(0, ASSERT_LINE); | |
110 | state->m_fromz80 = param; | |
107 | m_zready = 1; | |
108 | machine().device("mcu")->execute().set_input_line(0, ASSERT_LINE); | |
109 | m_fromz80 = param; | |
111 | 110 | } |
112 | 111 | |
113 | 112 | WRITE8_MEMBER(taitosj_state::taitosj_mcu_data_w) |
114 | 113 | { |
115 | 114 | LOG(("%04x: protection write %02x\n",space.device().safe_pc(),data)); |
116 | machine().scheduler().synchronize(FUNC(taitosj_mcu_real_data_w), data); | |
115 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(taitosj_state::taitosj_mcu_real_data_w),this), data); | |
117 | 116 | /* temporarily boost the interleave to sync things up */ |
118 | 117 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); |
119 | 118 | } |
r18112 | r18113 | |
168 | 167 | } |
169 | 168 | |
170 | 169 | /* timer callback : 68705 is going to read data from the Z80 */ |
171 | ||
170 | TIMER_CALLBACK_MEMBER(taitosj_state::taitosj_mcu_data_real_r) | |
172 | 171 | { |
173 | taitosj_state *state = machine.driver_data<taitosj_state>(); | |
174 | state->m_zready = 0; | |
172 | m_zready = 0; | |
175 | 173 | } |
176 | 174 | |
177 | 175 | /* timer callback : 68705 is writing data for the Z80 */ |
178 | ||
176 | TIMER_CALLBACK_MEMBER(taitosj_state::taitosj_mcu_status_real_w) | |
179 | 177 | { |
180 | taitosj_state *state = machine.driver_data<taitosj_state>(); | |
181 | state->m_toz80 = param; | |
182 | state->m_zaccept = 0; | |
178 | m_toz80 = param; | |
179 | m_zaccept = 0; | |
183 | 180 | } |
184 | 181 | |
185 | 182 | WRITE8_MEMBER(taitosj_state::taitosj_68705_portB_w) |
r18112 | r18113 | |
193 | 190 | if (~data & 0x02) |
194 | 191 | { |
195 | 192 | /* 68705 is going to read data from the Z80 */ |
196 | machine().scheduler().synchronize(FUNC(taitosj_mcu_data_real_r)); | |
193 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(taitosj_state::taitosj_mcu_data_real_r),this)); | |
197 | 194 | machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); |
198 | 195 | m_portA_in = m_fromz80; |
199 | 196 | LOG(("%04x: 68705 <- Z80 %02x\n", space.device().safe_pc(), m_portA_in)); |
r18112 | r18113 | |
207 | 204 | LOG(("%04x: 68705 -> Z80 %02x\n", space.device().safe_pc(), m_portA_out)); |
208 | 205 | |
209 | 206 | /* 68705 is writing data for the Z80 */ |
210 | machine().scheduler().synchronize(FUNC(taitosj_mcu_status_real_w), m_portA_out); | |
207 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(taitosj_state::taitosj_mcu_status_real_w),this), m_portA_out); | |
211 | 208 | } |
212 | 209 | if (~data & 0x10) |
213 | 210 | { |
r18112 | r18113 | |
---|---|---|
165 | 165 | } |
166 | 166 | |
167 | 167 | |
168 | ||
168 | TIMER_CALLBACK_MEMBER(vertigo_state::sound_command_w) | |
169 | 169 | { |
170 | vertigo_state *state = machine.driver_data<vertigo_state>(); | |
171 | exidy440_sound_command(state->m_custom, param); | |
170 | exidy440_sound_command(m_custom, param); | |
172 | 171 | |
173 | 172 | /* It is important that the sound cpu ACKs the sound command |
174 | 173 | quickly. Otherwise the main CPU gives up with sound. Boosting |
175 | 174 | the interleave for a while helps. */ |
176 | 175 | |
177 | machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); | |
176 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); | |
178 | 177 | } |
179 | 178 | |
180 | 179 | |
181 | 180 | WRITE16_MEMBER(vertigo_state::vertigo_audio_w) |
182 | 181 | { |
183 | 182 | if (ACCESSING_BITS_0_7) |
184 | machine().scheduler().synchronize(FUNC(sound_command_w), data & 0xff); | |
183 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(vertigo_state::sound_command_w),this), data & 0xff); | |
185 | 184 | } |
186 | 185 | |
187 | 186 |
r18112 | r18113 | |
---|---|---|
15 | 15 | #include "includes/namcos2.h" |
16 | 16 | #include "machine/nvram.h" |
17 | 17 | |
18 | ||
18 | ||
19 | 19 | static void InitC148(void); |
20 | 20 | |
21 | 21 | static emu_timer *namcos2_posirq_timer; |
r18112 | r18113 | |
108 | 108 | namcos2_kickstart = NULL; |
109 | 109 | namcos2_eeprom = auto_alloc_array(machine(), UINT8, namcos2_eeprom_size); |
110 | 110 | machine().device<nvram_device>("nvram")->set_base(namcos2_eeprom, namcos2_eeprom_size); |
111 | namcos2_posirq_timer = machine().scheduler().timer_alloc(FUNC(namcos2_posirq_tick)); | |
111 | namcos2_posirq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(namcos2_shared_state::namcos2_posirq_tick),this)); | |
112 | 112 | } |
113 | 113 | |
114 | 114 | MACHINE_RESET_MEMBER(namcos2_shared_state,namcos2) |
r18112 | r18113 | |
657 | 657 | return downcast<namcos2_state *>(state)->get_pos_irq_scanline(); |
658 | 658 | } |
659 | 659 | |
660 | ||
660 | TIMER_CALLBACK_MEMBER(namcos2_shared_state::namcos2_posirq_tick) | |
661 | 661 | { |
662 | namcos2_shared_state *state = machine.driver_data<namcos2_shared_state>(); | |
663 | if (state->is_system21()) { | |
662 | if (is_system21()) { | |
664 | 663 | if (namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ]) { |
665 | machine.primary_screen->update_partial(param); | |
666 | machine.device("gpu")->execute().set_input_line(namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
664 | machine().primary_screen->update_partial(param); | |
665 | machine().device("gpu")->execute().set_input_line(namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
667 | 666 | } |
668 | 667 | return; |
669 | 668 | } |
670 | 669 | |
671 | 670 | if (namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ]|namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ]) { |
672 | machine.primary_screen->update_partial(param); | |
673 | if (namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ]) machine.device("maincpu")->execute().set_input_line(namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
674 | if (namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ]) machine.device("slave")->execute().set_input_line(namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
671 | machine().primary_screen->update_partial(param); | |
672 | if (namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ]) machine().device("maincpu")->execute().set_input_line(namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
673 | if (namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ]) machine().device("slave")->execute().set_input_line(namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE); | |
675 | 674 | } |
676 | 675 | } |
677 | 676 |
r18112 | r18113 | |
---|---|---|
273 | 273 | }; |
274 | 274 | |
275 | 275 | |
276 | ||
276 | TIMER_CALLBACK_MEMBER(opwolf_state::opwolf_timer_callback) | |
277 | 277 | { |
278 | opwolf_state *state = machine.driver_data<opwolf_state>(); | |
279 | 278 | |
280 | 279 | // Level data command |
281 | if ( | |
280 | if (m_current_cmd == 0xf5) | |
282 | 281 | { |
283 | int level = | |
282 | int level = m_cchip_ram[0x1b]; | |
284 | 283 | const UINT16* level_data = level_data_lookup[level]; |
285 | 284 | int i = 0; |
286 | 285 | for (i = 0; i < 0xcc; i++) |
287 | 286 | { |
288 | state->m_cchip_ram[0x200 + i*2 + 0] = level_data[i]>>8; | |
289 | state->m_cchip_ram[0x200 + i*2 + 1] = level_data[i]&0xff; | |
287 | m_cchip_ram[0x200 + i*2 + 0] = level_data[i]>>8; | |
288 | m_cchip_ram[0x200 + i*2 + 1] = level_data[i]&0xff; | |
290 | 289 | } |
291 | 290 | |
292 | 291 | // The bootleg cchip writes 0 to these locations - hard to tell what the real one writes |
293 | state->m_cchip_ram[0x0] = 0; | |
294 | state->m_cchip_ram[0x76] = 0; | |
295 | state->m_cchip_ram[0x75] = 0; | |
296 | state->m_cchip_ram[0x74] = 0; | |
297 | state->m_cchip_ram[0x72] = 0; | |
298 | state->m_cchip_ram[0x71] = 0; | |
299 | state->m_cchip_ram[0x70] = 0; | |
300 | state->m_cchip_ram[0x66] = 0; | |
301 | state->m_cchip_ram[0x2b] = 0; | |
302 | state->m_cchip_ram[0x30] = 0; | |
303 | state->m_cchip_ram[0x31] = 0; | |
304 | state->m_cchip_ram[0x32] = 0; | |
305 | state->m_cchip_ram[0x27] = 0; | |
306 | state->m_c588 = 0; | |
307 | state->m_c589 = 0; | |
308 | state->m_c58a = 0; | |
292 | m_cchip_ram[0x0] = 0; | |
293 | m_cchip_ram[0x76] = 0; | |
294 | m_cchip_ram[0x75] = 0; | |
295 | m_cchip_ram[0x74] = 0; | |
296 | m_cchip_ram[0x72] = 0; | |
297 | m_cchip_ram[0x71] = 0; | |
298 | m_cchip_ram[0x70] = 0; | |
299 | m_cchip_ram[0x66] = 0; | |
300 | m_cchip_ram[0x2b] = 0; | |
301 | m_cchip_ram[0x30] = 0; | |
302 | m_cchip_ram[0x31] = 0; | |
303 | m_cchip_ram[0x32] = 0; | |
304 | m_cchip_ram[0x27] = 0; | |
305 | m_c588 = 0; | |
306 | m_c589 = 0; | |
307 | m_c58a = 0; | |
309 | 308 | |
310 | state->m_cchip_ram[0x1a] = 0; | |
311 | state->m_cchip_ram[0x7a] = 1; // Signal command complete | |
309 | m_cchip_ram[0x1a] = 0; | |
310 | m_cchip_ram[0x7a] = 1; // Signal command complete | |
312 | 311 | } |
313 | 312 | |
314 | | |
313 | m_current_cmd = 0; | |
315 | 314 | } |
316 | 315 | |
317 | 316 | static void updateDifficulty( running_machine &machine, int mode ) |
r18112 | r18113 | |
524 | 523 | * |
525 | 524 | *************************************/ |
526 | 525 | |
527 | ||
526 | TIMER_CALLBACK_MEMBER(opwolf_state::cchip_timer) | |
528 | 527 | { |
529 | opwolf_state *state = machine.driver_data<opwolf_state>(); | |
530 | 528 | |
531 | 529 | // Update input ports, these are used by both the 68k directly and by the c-chip |
532 | state->m_cchip_ram[0x4] = state->ioport("IN0")->read(); | |
533 | state->m_cchip_ram[0x5] = state->ioport("IN1")->read(); | |
530 | m_cchip_ram[0x4] = ioport("IN0")->read(); | |
531 | m_cchip_ram[0x5] = ioport("IN1")->read(); | |
534 | 532 | |
535 | 533 | // Coin slots |
536 | if ( | |
534 | if (m_cchip_ram[0x4] != m_cchip_last_04) | |
537 | 535 | { |
538 | 536 | int slot = -1; |
539 | 537 | |
540 | if (state->m_cchip_ram[0x4] & 1) slot = 0; | |
541 | if (state->m_cchip_ram[0x4] & 2) slot = 1; | |
538 | if (m_cchip_ram[0x4] & 1) slot = 0; | |
539 | if (m_cchip_ram[0x4] & 2) slot = 1; | |
542 | 540 | |
543 | 541 | if (slot != -1) |
544 | 542 | { |
545 | state->m_cchip_coins[slot]++; | |
546 | if (state->m_cchip_coins[slot] >= state->m_cchip_coins_for_credit[slot]) | |
543 | m_cchip_coins[slot]++; | |
544 | if (m_cchip_coins[slot] >= m_cchip_coins_for_credit[slot]) | |
547 | 545 | { |
548 | state->m_cchip_ram[0x53] += state->m_cchip_credits_for_coin[slot]; | |
549 | state->m_cchip_ram[0x51] = 0x55; | |
550 | state->m_cchip_ram[0x52] = 0x55; | |
551 | state->m_cchip_coins[slot] -= state->m_cchip_coins_for_credit[slot]; | |
546 | m_cchip_ram[0x53] += m_cchip_credits_for_coin[slot]; | |
547 | m_cchip_ram[0x51] = 0x55; | |
548 | m_cchip_ram[0x52] = 0x55; | |
549 | m_cchip_coins[slot] -= m_cchip_coins_for_credit[slot]; | |
552 | 550 | } |
553 | coin_counter_w(machine, slot, 1); | |
551 | coin_counter_w(machine(), slot, 1); | |
554 | 552 | } |
555 | 553 | |
556 | if (state->m_cchip_ram[0x53] > 9) | |
557 | state->m_cchip_ram[0x53] = 9; | |
554 | if (m_cchip_ram[0x53] > 9) | |
555 | m_cchip_ram[0x53] = 9; | |
558 | 556 | } |
559 | | |
557 | m_cchip_last_04 = m_cchip_ram[0x4]; | |
560 | 558 | |
561 | 559 | // Service switch |
562 | if ( | |
560 | if (m_cchip_ram[0x5] != m_cchip_last_05) | |
563 | 561 | { |
564 | if (( | |
562 | if ((m_cchip_ram[0x5] & 4)==0) | |
565 | 563 | { |
566 | state->m_cchip_ram[0x53]++; | |
567 | state->m_cchip_ram[0x51] = 0x55; | |
568 | state->m_cchip_ram[0x52] = 0x55; | |
564 | m_cchip_ram[0x53]++; | |
565 | m_cchip_ram[0x51] = 0x55; | |
566 | m_cchip_ram[0x52] = 0x55; | |
569 | 567 | } |
570 | 568 | } |
571 | | |
569 | m_cchip_last_05=m_cchip_ram[0x5]; | |
572 | 570 | |
573 | 571 | // Cchip handles coin lockout (68k flags error if more than 9 coins) |
574 | coin_lockout_w(machine, 1, state->m_cchip_ram[0x53] == 9); | |
575 | coin_lockout_w(machine, 0, state->m_cchip_ram[0x53] == 9); | |
576 | coin_counter_w(machine, 0, 0); | |
577 | coin_counter_w(machine, 1, 0); | |
572 | coin_lockout_w(machine(), 1, m_cchip_ram[0x53] == 9); | |
573 | coin_lockout_w(machine(), 0, m_cchip_ram[0x53] == 9); | |
574 | coin_counter_w(machine(), 0, 0); | |
575 | coin_counter_w(machine(), 1, 0); | |
578 | 576 | |
579 | 577 | // Special handling for last level |
580 | if ( | |
578 | if (m_cchip_ram[0x1b] == 0x6) | |
581 | 579 | { |
582 | 580 | // Check for triggering final helicopter (end boss) |
583 | if ( | |
581 | if (m_c58a == 0) | |
584 | 582 | { |
585 | if (( | |
583 | if ((m_cchip_ram[0x72] & 0x7f) >= 8 && m_cchip_ram[0x74] == 0 && m_cchip_ram[0x1c] == 0 && m_cchip_ram[0x1d] == 0 && m_cchip_ram[0x1f] == 0) | |
586 | 584 | { |
587 | state->m_cchip_ram[0x30] = 1; | |
588 | state->m_cchip_ram[0x74] = 1; | |
589 | state->m_c58a = 1; | |
585 | m_cchip_ram[0x30] = 1; | |
586 | m_cchip_ram[0x74] = 1; | |
587 | m_c58a = 1; | |
590 | 588 | } |
591 | 589 | } |
592 | 590 | |
593 | if (state->m_cchip_ram[0x1a] == 0x90) | |
594 | state->m_cchip_ram[0x74] = 0; | |
591 | if (m_cchip_ram[0x1a] == 0x90) | |
592 | m_cchip_ram[0x74] = 0; | |
595 | 593 | |
596 | if ( | |
594 | if (m_c58a != 0) | |
597 | 595 | { |
598 | if ( | |
596 | if (m_c589 == 0 && m_cchip_ram[0x27] == 0 && m_cchip_ram[0x75] == 0 && m_cchip_ram[0x1c] == 0 && m_cchip_ram[0x1d] == 0 && m_cchip_ram[0x1e] == 0 && m_cchip_ram[0x1f] == 0) | |
599 | 597 | { |
600 | state->m_cchip_ram[0x31] = 1; | |
601 | state->m_cchip_ram[0x75] = 1; | |
602 | state->m_c589 = 1; | |
598 | m_cchip_ram[0x31] = 1; | |
599 | m_cchip_ram[0x75] = 1; | |
600 | m_c589 = 1; | |
603 | 601 | } |
604 | 602 | } |
605 | 603 | |
606 | if ( | |
604 | if (m_cchip_ram[0x2b] == 0x1) | |
607 | 605 | { |
608 | | |
606 | m_cchip_ram[0x2b] = 0; | |
609 | 607 | |
610 | if ( | |
608 | if (m_cchip_ram[0x30] == 0x1) | |
611 | 609 | { |
612 | if (state->m_cchip_ram[0x1a] != 0x90) | |
613 | state->m_cchip_ram[0x1a]--; | |
610 | if (m_cchip_ram[0x1a] != 0x90) | |
611 | m_cchip_ram[0x1a]--; | |
614 | 612 | } |
615 | 613 | |
616 | if ( | |
614 | if (m_cchip_ram[0x72] == 0x9) | |
617 | 615 | { |
618 | if ( | |
616 | if (m_cchip_ram[0x76] != 0x4) | |
619 | 617 | { |
620 | | |
618 | m_cchip_ram[0x76] = 3; | |
621 | 619 | } |
622 | 620 | } |
623 | 621 | else |
624 | 622 | { |
625 | 623 | // This timer is derived from the bootleg rather than the real board, I'm not 100% sure about it |
626 | | |
624 | m_c588 |= 0x80; | |
627 | 625 | |
628 | state->m_cchip_ram[0x72] = state->m_c588; | |
629 | state->m_c588++; | |
626 | m_cchip_ram[0x72] = m_c588; | |
627 | m_c588++; | |
630 | 628 | |
631 | state->m_cchip_ram[0x1a]--; | |
632 | state->m_cchip_ram[0x1a]--; | |
633 | state->m_cchip_ram[0x1a]--; | |
629 | m_cchip_ram[0x1a]--; | |
630 | m_cchip_ram[0x1a]--; | |
631 | m_cchip_ram[0x1a]--; | |
634 | 632 | } |
635 | 633 | } |
636 | 634 | |
637 | 635 | // Update difficulty settings |
638 | if ( | |
636 | if (m_cchip_ram[0x76] == 0) | |
639 | 637 | { |
640 | state->m_cchip_ram[0x76] = 1; | |
641 | updateDifficulty(machine, 1); | |
638 | m_cchip_ram[0x76] = 1; | |
639 | updateDifficulty(machine(), 1); | |
642 | 640 | } |
643 | 641 | } |
644 | 642 | |
645 | 643 | // These variables are cleared every frame during attract mode and the intro. |
646 | if ( | |
644 | if (m_cchip_ram[0x34] < 2) | |
647 | 645 | { |
648 | updateDifficulty(machine, 0); | |
649 | state->m_cchip_ram[0x76] = 0; | |
650 | state->m_cchip_ram[0x75] = 0; | |
651 | state->m_cchip_ram[0x74] = 0; | |
652 | state->m_cchip_ram[0x72] = 0; | |
653 | state->m_cchip_ram[0x71] = 0; | |
654 | state->m_cchip_ram[0x70] = 0; | |
655 | state->m_cchip_ram[0x66] = 0; | |
656 | state->m_cchip_ram[0x2b] = 0; | |
657 | state->m_cchip_ram[0x30] = 0; | |
658 | state->m_cchip_ram[0x31] = 0; | |
659 | state->m_cchip_ram[0x32] = 0; | |
660 | state->m_cchip_ram[0x27] = 0; | |
661 | state->m_c588 = 0; | |
662 | state->m_c589 = 0; | |
663 | state->m_c58a = 0; | |
646 | updateDifficulty(machine(), 0); | |
647 | m_cchip_ram[0x76] = 0; | |
648 | m_cchip_ram[0x75] = 0; | |
649 | m_cchip_ram[0x74] = 0; | |
650 | m_cchip_ram[0x72] = 0; | |
651 | m_cchip_ram[0x71] = 0; | |
652 | m_cchip_ram[0x70] = 0; | |
653 | m_cchip_ram[0x66] = 0; | |
654 | m_cchip_ram[0x2b] = 0; | |
655 | m_cchip_ram[0x30] = 0; | |
656 | m_cchip_ram[0x31] = 0; | |
657 | m_cchip_ram[0x32] = 0; | |
658 | m_cchip_ram[0x27] = 0; | |
659 | m_c588 = 0; | |
660 | m_c589 = 0; | |
661 | m_c58a = 0; | |
664 | 662 | } |
665 | 663 | |
666 | 664 | // Check for level completion (all enemies destroyed) |
667 | if ( | |
665 | if (m_cchip_ram[0x1c] == 0 && m_cchip_ram[0x1d] == 0 && m_cchip_ram[0x1e] == 0 && m_cchip_ram[0x1f] == 0 && m_cchip_ram[0x20] == 0) | |
668 | 666 | { |
669 | 667 | // Special handling for end of level 6 |
670 | if ( | |
668 | if (m_cchip_ram[0x1b] == 0x6) | |
671 | 669 | { |
672 | 670 | // Don't signal end of level until final boss is destroyed |
673 | if (state->m_cchip_ram[0x27] == 0x1) | |
674 | state->m_cchip_ram[0x32] = 1; | |
671 | if (m_cchip_ram[0x27] == 0x1) | |
672 | m_cchip_ram[0x32] = 1; | |
675 | 673 | } |
676 | 674 | else |
677 | 675 | { |
678 | 676 | // Signal end of level |
679 | | |
677 | m_cchip_ram[0x32] = 1; | |
680 | 678 | } |
681 | 679 | } |
682 | 680 | |
683 | if ( | |
681 | if (m_cchip_ram[0xe] == 1) | |
684 | 682 | { |
685 | state->m_cchip_ram[0xe] = 0xfd; | |
686 | state->m_cchip_ram[0x61] = 0x04; | |
683 | m_cchip_ram[0xe] = 0xfd; | |
684 | m_cchip_ram[0x61] = 0x04; | |
687 | 685 | } |
688 | 686 | |
689 | 687 | // Access level data command (address 0xf5 goes from 1 -> 0) |
690 | if ( | |
688 | if (m_cchip_ram[0x7a] == 0 && m_cchip_last_7a != 0 && m_current_cmd != 0xf5) | |
691 | 689 | { |
692 | 690 | // Simulate time for command to execute (exact timing unknown, this is close) |
693 | state->m_current_cmd = 0xf5; | |
694 | machine.scheduler().timer_set(state->m_maincpu->cycles_to_attotime(80000), FUNC(opwolf_timer_callback)); | |
691 | m_current_cmd = 0xf5; | |
692 | machine().scheduler().timer_set(m_maincpu->cycles_to_attotime(80000), timer_expired_delegate(FUNC(opwolf_state::opwolf_timer_callback),this)); | |
695 | 693 | } |
696 | | |
694 | m_cchip_last_7a = m_cchip_ram[0x7a]; | |
697 | 695 | |
698 | 696 | // This seems to some kind of periodic counter - results are expected |
699 | 697 | // by the 68k when the counter reaches 0xa |
700 | if ( | |
698 | if (m_cchip_ram[0x7f] == 0xa) | |
701 | 699 | { |
702 | state->m_cchip_ram[0xfe] = 0xf7; | |
703 | state->m_cchip_ram[0xff] = 0x6e; | |
700 | m_cchip_ram[0xfe] = 0xf7; | |
701 | m_cchip_ram[0xff] = 0x6e; | |
704 | 702 | } |
705 | 703 | |
706 | 704 | // These are set every frame |
707 | state->m_cchip_ram[0x64] = 0; | |
708 | state->m_cchip_ram[0x66] = 0; | |
705 | m_cchip_ram[0x64] = 0; | |
706 | m_cchip_ram[0x66] = 0; | |
709 | 707 | } |
710 | 708 | |
711 | 709 | /************************************* |
r18112 | r18113 | |
747 | 745 | state->m_cchip_coins_for_credit[1] = 1; |
748 | 746 | state->m_cchip_credits_for_coin[1] = 1; |
749 | 747 | |
750 | machine.scheduler().timer_pulse(attotime::from_hz(60), FUNC(cchip_timer)); | |
748 | machine.scheduler().timer_pulse(attotime::from_hz(60), timer_expired_delegate(FUNC(opwolf_state::cchip_timer),state)); | |
751 | 749 | } |
r18112 | r18113 | |
---|---|---|
40 | 40 | * |
41 | 41 | *************************************/ |
42 | 42 | |
43 | ||
43 | ||
44 | 44 | static DECLARE_WRITE8_DEVICE_HANDLER( ipu_break_changed ); |
45 | 45 | |
46 | 46 | |
r18112 | r18113 | |
164 | 164 | MACHINE_START_MEMBER(mcr_state,nflfoot) |
165 | 165 | { |
166 | 166 | /* allocate a timer for the IPU watchdog */ |
167 | ipu_watchdog_timer = machine().scheduler().timer_alloc(FUNC(ipu_watchdog_reset)); | |
167 | ipu_watchdog_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mcr_state::ipu_watchdog_reset),this)); | |
168 | 168 | } |
169 | 169 | |
170 | 170 | |
r18112 | r18113 | |
250 | 250 | } |
251 | 251 | |
252 | 252 | |
253 | ||
253 | TIMER_CALLBACK_MEMBER(mcr_state::ipu_watchdog_reset) | |
254 | 254 | { |
255 | 255 | logerror("ipu_watchdog_reset\n"); |
256 | machine.device("ipu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); | |
257 | machine.device("ipu_ctc")->reset(); | |
258 | machine.device("ipu_pio0")->reset(); | |
259 | machine.device("ipu_pio1")->reset(); | |
260 | machine.device("ipu_sio")->reset(); | |
256 | machine().device("ipu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE); | |
257 | machine().device("ipu_ctc")->reset(); | |
258 | machine().device("ipu_pio0")->reset(); | |
259 | machine().device("ipu_pio1")->reset(); | |
260 | machine().device("ipu_sio")->reset(); | |
261 | 261 | } |
262 | 262 | |
263 | 263 |
r18112 | r18113 | |
---|---|---|
56 | 56 | virtual void video_start(); |
57 | 57 | virtual void palette_init(); |
58 | 58 | UINT32 screen_update_buggychl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
59 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
59 | 60 | }; |
r18112 | r18113 | |
---|---|---|
143 | 143 | void screen_eof_taitof2_full_buffer_delayed(screen_device &screen, bool state); |
144 | 144 | void screen_eof_taitof2_partial_buffer_delayed_qzchikyu(screen_device &screen, bool state); |
145 | 145 | INTERRUPT_GEN_MEMBER(taitof2_interrupt); |
146 | TIMER_CALLBACK_MEMBER(taitof2_interrupt6); | |
146 | 147 | }; |
r18112 | r18113 | |
---|---|---|
96 | 96 | DECLARE_MACHINE_RESET(common); |
97 | 97 | DECLARE_MACHINE_RESET(ta7630); |
98 | 98 | UINT32 screen_update_fortyl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
99 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
99 | 100 | }; |
r18112 | r18113 | |
---|---|---|
303 | 303 | DECLARE_VIDEO_START(screwloo); |
304 | 304 | UINT32 screen_update_gottlieb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
305 | 305 | INTERRUPT_GEN_MEMBER(gottlieb_interrupt); |
306 | TIMER_CALLBACK_MEMBER(laserdisc_philips_callback); | |
307 | TIMER_CALLBACK_MEMBER(laserdisc_bit_off_callback); | |
308 | TIMER_CALLBACK_MEMBER(laserdisc_bit_callback); | |
309 | TIMER_CALLBACK_MEMBER(nmi_clear); | |
306 | 310 | }; |
307 | 311 | |
308 | 312 | /*----------- defined in video/gottlieb.c -----------*/ |
r18112 | r18113 | |
---|---|---|
60 | 60 | void screen_eof_galaga(screen_device &screen, bool state); |
61 | 61 | INTERRUPT_GEN_MEMBER(main_vblank_irq); |
62 | 62 | INTERRUPT_GEN_MEMBER(sub_vblank_irq); |
63 | TIMER_CALLBACK_MEMBER(cpu3_interrupt_callback); | |
63 | 64 | }; |
64 | 65 | |
65 | 66 | class xevious_state : public galaga_state |
r18112 | r18113 | |
---|---|---|
26 | 26 | DECLARE_VIDEO_START(qwak); |
27 | 27 | UINT32 screen_update_runaway(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
28 | 28 | UINT32 screen_update_qwak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
29 | TIMER_CALLBACK_MEMBER(interrupt_callback); | |
29 | 30 | }; |
r18112 | r18113 | |
---|---|---|
39 | 39 | virtual void video_start(); |
40 | 40 | UINT32 screen_update_groundfx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
41 | 41 | INTERRUPT_GEN_MEMBER(groundfx_interrupt); |
42 | TIMER_CALLBACK_MEMBER(groundfx_interrupt5); | |
42 | 43 | }; |
r18112 | r18113 | |
---|---|---|
115 | 115 | virtual void video_start(); |
116 | 116 | virtual void video_reset(); |
117 | 117 | INTERRUPT_GEN_MEMBER(micro3d_vblank); |
118 | TIMER_CALLBACK_MEMBER(mac_done_callback); | |
119 | TIMER_CALLBACK_MEMBER(adc_done_callback); | |
118 | 120 | }; |
119 | 121 | |
120 | 122 | struct micro3d_vtx |
r18112 | r18113 | |
---|---|---|
544 | 544 | UINT16 *m_snes_cgram; /* Palette RAM */ |
545 | 545 | UINT8 *m_snes_vram; /* Video RAM (TODO: Should be 16-bit, but it's easier this way) */ |
546 | 546 | |
547 | TIMER_CALLBACK_MEMBER(snes_nmi_tick); | |
548 | TIMER_CALLBACK_MEMBER(snes_hirq_tick_callback); | |
549 | TIMER_CALLBACK_MEMBER(snes_reset_oam_address); | |
550 | TIMER_CALLBACK_MEMBER(snes_reset_hdma); | |
551 | TIMER_CALLBACK_MEMBER(snes_update_io); | |
552 | TIMER_CALLBACK_MEMBER(snes_scanline_tick); | |
553 | TIMER_CALLBACK_MEMBER(snes_hblank_tick); | |
547 | 554 | }; |
548 | 555 | |
549 | 556 | /* Special chips, checked at init and used in memory handlers */ |
r18112 | r18113 | |
---|---|---|
86 | 86 | UINT32 screen_update_dblaxle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
87 | 87 | UINT32 screen_update_racingb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
88 | 88 | INTERRUPT_GEN_MEMBER(sci_interrupt); |
89 | TIMER_CALLBACK_MEMBER(taitoz_interrupt6); | |
90 | TIMER_CALLBACK_MEMBER(taitoz_cpub_interrupt5); | |
89 | 91 | }; |
r18112 | r18113 | |
---|---|---|
45 | 45 | virtual void machine_reset(); |
46 | 46 | UINT32 screen_update_vendetta(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
47 | 47 | INTERRUPT_GEN_MEMBER(vendetta_irq); |
48 | TIMER_CALLBACK_MEMBER(z80_nmi_callback); | |
48 | 49 | }; |
49 | 50 | |
50 | 51 | /*----------- defined in video/vendetta.c -----------*/ |
r18112 | r18113 | |
---|---|---|
81 | 81 | UINT32 screen_update_sheriff(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
82 | 82 | UINT32 screen_update_helifire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
83 | 83 | void screen_eof_helifire(screen_device &screen, bool state); |
84 | TIMER_CALLBACK_MEMBER(spacefev_stop_red_cannon); | |
84 | 85 | }; |
85 | 86 | |
86 | 87 | /*----------- defined in video/n8080.c -----------*/ |
r18112 | r18113 | |
---|---|---|
73 | 73 | virtual void video_start(); |
74 | 74 | DECLARE_MACHINE_RESET(ta7630); |
75 | 75 | UINT32 screen_update_msisaac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
76 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
76 | 77 | }; |
r18112 | r18113 | |
---|---|---|
44 | 44 | virtual void machine_reset(); |
45 | 45 | virtual void video_start(); |
46 | 46 | UINT32 screen_update_fuuki16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
47 | TIMER_CALLBACK_MEMBER(level_1_interrupt_callback); | |
48 | TIMER_CALLBACK_MEMBER(vblank_interrupt_callback); | |
49 | TIMER_CALLBACK_MEMBER(raster_interrupt_callback); | |
47 | 50 | }; |
r18112 | r18113 | |
---|---|---|
169 | 169 | UINT32 screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
170 | 170 | UINT32 screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
171 | 171 | UINT32 screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
172 | TIMER_CALLBACK_MEMBER(sgladiat_sndirq_update_callback); | |
173 | TIMER_CALLBACK_MEMBER(sndirq_update_callback); | |
172 | 174 | }; |
r18112 | r18113 | |
---|---|---|
131 | 131 | UINT32 screen_update_turbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
132 | 132 | UINT32 screen_update_subroc3d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
133 | 133 | UINT32 screen_update_buckrog(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
134 | TIMER_CALLBACK_MEMBER(delayed_i8255_w); | |
134 | 135 | }; |
135 | 136 | |
136 | 137 |
r18112 | r18113 | |
---|---|---|
178 | 178 | UINT32 screen_update_multi32_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
179 | 179 | UINT32 screen_update_multi32_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
180 | 180 | INTERRUPT_GEN_MEMBER(start_of_vblank_int); |
181 | TIMER_CALLBACK_MEMBER(end_of_vblank_int); | |
182 | TIMER_CALLBACK_MEMBER(update_sprites); | |
181 | 183 | }; |
182 | 184 | |
183 | 185 | /*----------- defined in machine/segas32.c -----------*/ |
r18112 | r18113 | |
---|---|---|
273 | 273 | UINT32 screen_update_f3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
274 | 274 | void screen_eof_f3(screen_device &screen, bool state); |
275 | 275 | INTERRUPT_GEN_MEMBER(f3_interrupt2); |
276 | TIMER_CALLBACK_MEMBER(f3_interrupt3); | |
276 | 277 | }; |
r18112 | r18113 | |
---|---|---|
64 | 64 | UINT32 screen_update_exctsccr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
65 | 65 | void screen_eof_champbas(screen_device &screen, bool state); |
66 | 66 | INTERRUPT_GEN_MEMBER(vblank_irq); |
67 | TIMER_CALLBACK_MEMBER(exctsccr_fm_callback); | |
67 | 68 | }; |
r18112 | r18113 | |
---|---|---|
106 | 106 | DECLARE_PALETTE_INIT(splndrbt); |
107 | 107 | UINT32 screen_update_equites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
108 | 108 | UINT32 screen_update_splndrbt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
109 | TIMER_CALLBACK_MEMBER(equites_nmi_callback); | |
110 | TIMER_CALLBACK_MEMBER(equites_frq_adjuster_callback); | |
109 | 111 | }; |
r18112 | r18113 | |
---|---|---|
79 | 79 | DECLARE_VIDEO_START(arkanoid); |
80 | 80 | UINT32 screen_update_arkanoid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
81 | 81 | UINT32 screen_update_hexa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
82 | TIMER_CALLBACK_MEMBER(test); | |
82 | 83 | }; |
r18112 | r18113 | |
---|---|---|
105 | 105 | UINT32 screen_update_superbug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
106 | 106 | UINT32 screen_update_montecar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
107 | 107 | INTERRUPT_GEN_MEMBER(firetrk_interrupt); |
108 | TIMER_CALLBACK_MEMBER(periodic_callback); | |
108 | 109 | }; |
109 | 110 | |
110 | 111 |
r18112 | r18113 | |
---|---|---|
54 | 54 | virtual void machine_reset(); |
55 | 55 | DECLARE_VIDEO_START(crgolf); |
56 | 56 | UINT32 screen_update_crgolf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
57 | TIMER_CALLBACK_MEMBER(main_to_sound_callback); | |
58 | TIMER_CALLBACK_MEMBER(sound_to_main_callback); | |
57 | 59 | }; |
58 | 60 | |
59 | 61 | /*----------- defined in video/crgolf.c -----------*/ |
r18112 | r18113 | |
---|---|---|
61 | 61 | DECLARE_MACHINE_RESET(lsasquad); |
62 | 62 | UINT32 screen_update_lsasquad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
63 | 63 | UINT32 screen_update_daikaiju(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
64 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
64 | 65 | }; |
r18112 | r18113 | |
---|---|---|
70 | 70 | virtual void video_start(); |
71 | 71 | DECLARE_VIDEO_START(raaspec); |
72 | 72 | UINT32 screen_update_vectrex(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
73 | TIMER_CALLBACK_MEMBER(vectrex_imager_change_color); | |
74 | TIMER_CALLBACK_MEMBER(update_level); | |
75 | TIMER_CALLBACK_MEMBER(vectrex_imager_eye); | |
76 | TIMER_CALLBACK_MEMBER(lightpen_trigger); | |
77 | TIMER_CALLBACK_MEMBER(vectrex_refresh); | |
78 | TIMER_CALLBACK_MEMBER(vectrex_zero_integrators); | |
79 | TIMER_CALLBACK_MEMBER(update_signal); | |
73 | 80 | }; |
74 | 81 | |
75 | 82 |
r18112 | r18113 | |
---|---|---|
107 | 107 | UINT32 screen_update_williams(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
108 | 108 | UINT32 screen_update_williams2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
109 | 109 | UINT32 screen_update_blaster(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
110 | TIMER_CALLBACK_MEMBER(williams_count240_off_callback); | |
111 | TIMER_CALLBACK_MEMBER(williams2_endscreen_off_callback); | |
112 | TIMER_CALLBACK_MEMBER(williams_deferred_snd_cmd_w); | |
113 | TIMER_CALLBACK_MEMBER(blaster_deferred_snd_cmd_w); | |
114 | TIMER_CALLBACK_MEMBER(williams2_deferred_snd_cmd_w); | |
110 | 115 | }; |
111 | 116 | |
112 | 117 | |
r18112 | r18113 | |
121 | 126 | DECLARE_DRIVER_INIT(joust2); |
122 | 127 | DECLARE_MACHINE_START(joust2); |
123 | 128 | DECLARE_MACHINE_RESET(joust2); |
124 | ||
129 | TIMER_CALLBACK_MEMBER(joust2_deferred_snd_cmd_w); | |
125 | 130 | }; |
126 | 131 | |
127 | 132 | /*----------- defined in drivers/williams.c -----------*/ |
r18112 | r18113 | |
---|---|---|
63 | 63 | virtual void video_start(); |
64 | 64 | UINT32 screen_update_fuuki32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
65 | 65 | void screen_eof_fuuki32(screen_device &screen, bool state); |
66 | TIMER_CALLBACK_MEMBER(level_1_interrupt_callback); | |
67 | TIMER_CALLBACK_MEMBER(vblank_interrupt_callback); | |
68 | TIMER_CALLBACK_MEMBER(raster_interrupt_callback); | |
66 | 69 | }; |
r18112 | r18113 | |
---|---|---|
90 | 90 | virtual void video_start(); |
91 | 91 | UINT32 screen_update_changela(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
92 | 92 | INTERRUPT_GEN_MEMBER(chl_mcu_irq); |
93 | TIMER_CALLBACK_MEMBER(changela_scanline_callback); | |
93 | 94 | }; |
r18112 | r18113 | |
---|---|---|
51 | 51 | virtual void video_start(); |
52 | 52 | virtual void palette_init(); |
53 | 53 | UINT32 screen_update_triplhnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
54 | TIMER_CALLBACK_MEMBER(triplhnt_hit_callback); | |
54 | 55 | }; |
55 | 56 | |
56 | 57 |
r18112 | r18113 | |
---|---|---|
62 | 62 | DECLARE_DRIVER_INIT(esb); |
63 | 63 | DECLARE_DRIVER_INIT(starwars); |
64 | 64 | virtual void machine_reset(); |
65 | TIMER_CALLBACK_MEMBER(math_run_clear); | |
65 | 66 | }; |
66 | 67 | |
67 | 68 |
r18112 | r18113 | |
---|---|---|
56 | 56 | virtual void palette_init(); |
57 | 57 | UINT32 screen_update_wolfpack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
58 | 58 | void screen_eof_wolfpack(screen_device &screen, bool state); |
59 | TIMER_CALLBACK_MEMBER(periodic_callback); | |
59 | 60 | }; |
r18112 | r18113 | |
---|---|---|
47 | 47 | virtual void palette_init(); |
48 | 48 | UINT32 screen_update_stfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
49 | 49 | INTERRUPT_GEN_MEMBER(stfight_vb_interrupt); |
50 | TIMER_CALLBACK_MEMBER(stfight_interrupt_1); | |
50 | 51 | }; |
51 | 52 | |
52 | 53 | /*----------- defined in machine/stfight.c -----------*/ |
r18112 | r18113 | |
---|---|---|
44 | 44 | virtual void machine_reset(); |
45 | 45 | UINT32 screen_update_asterix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
46 | 46 | INTERRUPT_GEN_MEMBER(asterix_interrupt); |
47 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
47 | 48 | }; |
48 | 49 | |
49 | 50 | /*----------- defined in video/asterix.c -----------*/ |
r18112 | r18113 | |
---|---|---|
53 | 53 | INTERRUPT_GEN_MEMBER(toypop_main_vblank_irq); |
54 | 54 | INTERRUPT_GEN_MEMBER(toypop_sound_timer_irq); |
55 | 55 | INTERRUPT_GEN_MEMBER(toypop_m68000_interrupt); |
56 | TIMER_CALLBACK_MEMBER(namcoio_run); | |
56 | 57 | }; |
r18112 | r18113 | |
---|---|---|
104 | 104 | virtual void video_start(); |
105 | 105 | DECLARE_MACHINE_RESET(ta7630); |
106 | 106 | UINT32 screen_update_nycaptor(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
107 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
107 | 108 | }; |
r18112 | r18113 | |
---|---|---|
84 | 84 | virtual void machine_reset(); |
85 | 85 | DECLARE_MACHINE_START(qixmcu); |
86 | 86 | DECLARE_VIDEO_START(qix); |
87 | TIMER_CALLBACK_MEMBER(pia_w_callback); | |
87 | 88 | }; |
88 | 89 | |
89 | 90 |
r18112 | r18113 | |
---|---|---|
72 | 72 | UINT8 *m_charram; |
73 | 73 | DECLARE_CUSTOM_INPUT_MEMBER(cdp1869_pcb_r); |
74 | 74 | DECLARE_INPUT_CHANGED_MEMBER(ef_w); |
75 | TIMER_CALLBACK_MEMBER(set_cpu_mode); | |
75 | 76 | }; |
76 | 77 | |
77 | 78 | class draco_state : public cidelsa_state |
r18112 | r18113 | |
---|---|---|
110 | 110 | DECLARE_MACHINE_RESET(common); |
111 | 111 | UINT32 screen_update_bublbobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
112 | 112 | INTERRUPT_GEN_MEMBER(bublbobl_m68705_interrupt); |
113 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
114 | TIMER_CALLBACK_MEMBER(bublbobl_m68705_irq_ack); | |
113 | 115 | }; |
r18112 | r18113 | |
---|---|---|
105 | 105 | virtual void palette_init(); |
106 | 106 | UINT32 screen_update_lockon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
107 | 107 | void screen_eof_lockon(screen_device &screen, bool state); |
108 | TIMER_CALLBACK_MEMBER(cursor_callback); | |
109 | TIMER_CALLBACK_MEMBER(bufend_callback); | |
108 | 110 | }; |
r18112 | r18113 | |
---|---|---|
199 | 199 | void screen_eof_seta_buffer_sprites(screen_device &screen, bool state); |
200 | 200 | void screen_eof_setaroul(screen_device &screen, bool state); |
201 | 201 | INTERRUPT_GEN_MEMBER(wrofaero_interrupt); |
202 | TIMER_CALLBACK_MEMBER(uPD71054_timer_callback); | |
203 | TIMER_CALLBACK_MEMBER(keroppi_prize_hop_callback); | |
202 | 204 | }; |
203 | 205 | |
204 | 206 | /*----------- defined in video/seta.c -----------*/ |
r18112 | r18113 | |
---|---|---|
99 | 99 | UINT32 screen_update_tnzs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
100 | 100 | void screen_eof_tnzs(screen_device &screen, bool state); |
101 | 101 | INTERRUPT_GEN_MEMBER(arknoid2_interrupt); |
102 | TIMER_CALLBACK_MEMBER(kludge_callback); | |
102 | 103 | }; |
r18112 | r18113 | |
---|---|---|
47 | 47 | DECLARE_VIDEO_START(mystston); |
48 | 48 | DECLARE_VIDEO_RESET(mystston); |
49 | 49 | UINT32 screen_update_mystston(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
50 | TIMER_CALLBACK_MEMBER(interrupt_callback); | |
50 | 51 | }; |
51 | 52 | |
52 | 53 | /*----------- defined in drivers/mystston.c -----------*/ |
r18112 | r18113 | |
---|---|---|
107 | 107 | DECLARE_VIDEO_START(midyunit_6bit); |
108 | 108 | DECLARE_VIDEO_START(mkyawdim); |
109 | 109 | DECLARE_VIDEO_START(common); |
110 | TIMER_CALLBACK_MEMBER(dma_callback); | |
111 | TIMER_CALLBACK_MEMBER(autoerase_line); | |
110 | 112 | }; |
111 | 113 | /*----------- defined in video/midyunit.c -----------*/ |
112 | 114 | void midyunit_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg); |
r18112 | r18113 | |
---|---|---|
112 | 112 | DECLARE_VIDEO_START(nbmj9195_nb22090); |
113 | 113 | UINT32 screen_update_nbmj9195(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
114 | 114 | INTERRUPT_GEN_MEMBER(ctc0_trg1); |
115 | TIMER_CALLBACK_MEMBER(blitter_timer_callback); | |
115 | 116 | }; |
116 | 117 | |
117 | 118 | /*----------- defined in video/nbmj9195.c -----------*/ |
r18112 | r18113 | |
---|---|---|
49 | 49 | virtual void machine_start(); |
50 | 50 | virtual void machine_reset(); |
51 | 51 | virtual void video_start(); |
52 | TIMER_CALLBACK_MEMBER(irq_off); | |
52 | 53 | }; |
53 | 54 | |
54 | 55 |
r18112 | r18113 | |
---|---|---|
70 | 70 | DECLARE_VIDEO_START(wgp2); |
71 | 71 | UINT32 screen_update_wgp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
72 | 72 | INTERRUPT_GEN_MEMBER(wgp_cpub_interrupt); |
73 | TIMER_CALLBACK_MEMBER(wgp_interrupt4); | |
74 | TIMER_CALLBACK_MEMBER(wgp_interrupt6); | |
75 | TIMER_CALLBACK_MEMBER(wgp_cpub_interrupt6); | |
73 | 76 | }; |
r18112 | r18113 | |
---|---|---|
78 | 78 | virtual void video_start(); |
79 | 79 | virtual void palette_init(); |
80 | 80 | UINT32 screen_update_irobot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
81 | TIMER_CALLBACK_MEMBER(scanline_callback); | |
81 | 82 | }; |
82 | 83 | |
83 | 84 | /*----------- defined in machine/irobot.c -----------*/ |
r18112 | r18113 | |
---|---|---|
48 | 48 | virtual void palette_init(); |
49 | 49 | UINT32 screen_update_dcheese(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
50 | 50 | INTERRUPT_GEN_MEMBER(dcheese_vblank); |
51 | TIMER_CALLBACK_MEMBER(blitter_scanline_callback); | |
52 | TIMER_CALLBACK_MEMBER(dcheese_signal_irq_callback); | |
51 | 53 | }; |
52 | 54 | |
53 | 55 | /*----------- defined in drivers/dcheese.c -----------*/ |
r18112 | r18113 | |
---|---|---|
68 | 68 | virtual void machine_reset(); |
69 | 69 | virtual void video_start(); |
70 | 70 | UINT32 screen_update_ccastles(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
71 | TIMER_CALLBACK_MEMBER(clock_irq); | |
71 | 72 | }; |
r18112 | r18113 | |
---|---|---|
210 | 210 | virtual void video_start(); |
211 | 211 | virtual void video_reset(); |
212 | 212 | UINT32 screen_update_neogeo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
213 | TIMER_CALLBACK_MEMBER(display_position_interrupt_callback); | |
214 | TIMER_CALLBACK_MEMBER(display_position_vblank_callback); | |
215 | TIMER_CALLBACK_MEMBER(vblank_interrupt_callback); | |
216 | TIMER_CALLBACK_MEMBER(auto_animation_timer_callback); | |
217 | TIMER_CALLBACK_MEMBER(sprite_line_timer_callback); | |
213 | 218 | }; |
214 | 219 | |
215 | 220 |
r18112 | r18113 | |
---|---|---|
48 | 48 | virtual void video_start(); |
49 | 49 | UINT32 screen_update_policetr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
50 | 50 | INTERRUPT_GEN_MEMBER(irq4_gen); |
51 | TIMER_CALLBACK_MEMBER(irq5_gen); | |
51 | 52 | }; |
r18112 | r18113 | |
---|---|---|
58 | 58 | DECLARE_DRIVER_INIT(9ballsht); |
59 | 59 | DECLARE_MACHINE_RESET(amerdart); |
60 | 60 | DECLARE_MACHINE_RESET(coolpool); |
61 | TIMER_CALLBACK_MEMBER(deferred_iop_w); | |
61 | 62 | }; |
r18112 | r18113 | |
---|---|---|
97 | 97 | virtual void video_start(); |
98 | 98 | DECLARE_MACHINE_RESET(naomi); |
99 | 99 | UINT32 screen_update_dc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
100 | TIMER_CALLBACK_MEMBER(aica_dma_irq); | |
101 | TIMER_CALLBACK_MEMBER(pvr_dma_irq); | |
102 | TIMER_CALLBACK_MEMBER(ch2_dma_irq); | |
103 | TIMER_CALLBACK_MEMBER(yuv_fifo_irq); | |
104 | TIMER_CALLBACK_MEMBER(dc_rtc_increment); | |
105 | TIMER_CALLBACK_MEMBER(transfer_opaque_list_irq); | |
106 | TIMER_CALLBACK_MEMBER(transfer_opaque_modifier_volume_list_irq); | |
107 | TIMER_CALLBACK_MEMBER(transfer_translucent_list_irq); | |
108 | TIMER_CALLBACK_MEMBER(transfer_translucent_modifier_volume_list_irq); | |
109 | TIMER_CALLBACK_MEMBER(transfer_punch_through_list_irq); | |
110 | TIMER_CALLBACK_MEMBER(vbin); | |
111 | TIMER_CALLBACK_MEMBER(vbout); | |
112 | TIMER_CALLBACK_MEMBER(hbin); | |
113 | TIMER_CALLBACK_MEMBER(endofrender_video); | |
114 | TIMER_CALLBACK_MEMBER(endofrender_tsp); | |
115 | TIMER_CALLBACK_MEMBER(endofrender_isp); | |
100 | 116 | }; |
101 | 117 | |
102 | 118 | /*----------- defined in machine/dc.c -----------*/ |
r18112 | r18113 | |
---|---|---|
65 | 65 | DECLARE_DRIVER_INIT(mk2); |
66 | 66 | DECLARE_MACHINE_RESET(midtunit); |
67 | 67 | DECLARE_VIDEO_START(midtunit); |
68 | TIMER_CALLBACK_MEMBER(dma_callback); | |
68 | 69 | }; |
69 | 70 | /*----------- defined in video/midtunit.c -----------*/ |
70 | 71 | extern UINT8 midtunit_gfx_rom_large; |
r18112 | r18113 | |
---|---|---|
45 | 45 | struct counter_state m_m6840_state[3]; |
46 | 46 | UINT8 m_v493_irq_state; |
47 | 47 | UINT8 m_v493_irq_vector; |
48 | timer_expired_func m_v493_callback; | |
49 | const char *m_v493_callback_name; | |
48 | timer_expired_delegate m_v493_callback; | |
50 | 49 | UINT8 m_zwackery_sound_data; |
51 | 50 | attotime m_m6840_counter_periods[3]; |
52 | 51 | attotime m_m6840_internal_counter_period; |
r18112 | r18113 | |
99 | 98 | UINT32 screen_update_zwackery(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
100 | 99 | UINT32 screen_update_mcr68(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
101 | 100 | INTERRUPT_GEN_MEMBER(mcr68_interrupt); |
101 | TIMER_CALLBACK_MEMBER(mcr68_493_off_callback); | |
102 | TIMER_CALLBACK_MEMBER(mcr68_493_callback); | |
103 | TIMER_CALLBACK_MEMBER(zwackery_493_off_callback); | |
104 | TIMER_CALLBACK_MEMBER(zwackery_493_callback); | |
105 | TIMER_CALLBACK_MEMBER(counter_fired_callback); | |
102 | 106 | }; |
103 | 107 | |
104 | 108 | /*----------- defined in machine/mcr68.c -----------*/ |
r18112 | r18113 | |
---|---|---|
37 | 37 | virtual void machine_reset(); |
38 | 38 | virtual void video_start(); |
39 | 39 | UINT32 screen_update_rollerg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
40 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
40 | 41 | }; |
41 | 42 | |
42 | 43 | /*----------- defined in video/rollerg.c -----------*/ |
r18112 | r18113 | |
---|---|---|
81 | 81 | virtual void video_start(); |
82 | 82 | UINT32 screen_update_niyanpai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
83 | 83 | INTERRUPT_GEN_MEMBER(niyanpai_interrupt); |
84 | TIMER_CALLBACK_MEMBER(blitter_timer_callback); | |
84 | 85 | }; |
r18112 | r18113 | |
---|---|---|
194 | 194 | virtual void video_start(); |
195 | 195 | UINT32 screen_update_balsente(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
196 | 196 | INTERRUPT_GEN_MEMBER(balsente_update_analog_inputs); |
197 | TIMER_CALLBACK_MEMBER(irq_off); | |
198 | TIMER_CALLBACK_MEMBER(m6850_data_ready_callback); | |
199 | TIMER_CALLBACK_MEMBER(m6850_w_callback); | |
200 | TIMER_CALLBACK_MEMBER(adc_finished); | |
197 | 201 | }; |
198 | 202 | |
199 | 203 |
r18112 | r18113 | |
---|---|---|
49 | 49 | DECLARE_VIDEO_START(jumping); |
50 | 50 | UINT32 screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
51 | 51 | UINT32 screen_update_jumping(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
52 | TIMER_CALLBACK_MEMBER(cchip_timer); | |
52 | 53 | }; |
53 | 54 | |
54 | 55 | /*----------- defined in machine/rainbow.c -----------*/ |
r18112 | r18113 | |
---|---|---|
46 | 46 | UINT32 screen_update_undrfire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
47 | 47 | UINT32 screen_update_cbombers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
48 | 48 | INTERRUPT_GEN_MEMBER(undrfire_interrupt); |
49 | TIMER_CALLBACK_MEMBER(interrupt5); | |
49 | 50 | }; |
r18112 | r18113 | |
---|---|---|
58 | 58 | INTERRUPT_GEN_MEMBER(mappy_main_vblank_irq); |
59 | 59 | INTERRUPT_GEN_MEMBER(sub_vblank_irq); |
60 | 60 | INTERRUPT_GEN_MEMBER(sub2_vblank_irq); |
61 | TIMER_CALLBACK_MEMBER(superpac_io_run); | |
62 | TIMER_CALLBACK_MEMBER(pacnpal_io_run); | |
63 | TIMER_CALLBACK_MEMBER(phozon_io_run); | |
64 | TIMER_CALLBACK_MEMBER(mappy_io_run); | |
61 | 65 | }; |
r18112 | r18113 | |
---|---|---|
106 | 106 | DECLARE_PALETTE_INIT(cvs); |
107 | 107 | UINT32 screen_update_cvs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
108 | 108 | INTERRUPT_GEN_MEMBER(cvs_main_cpu_interrupt); |
109 | TIMER_CALLBACK_MEMBER(cvs_393hz_timer_cb); | |
109 | 110 | }; |
110 | 111 | |
111 | 112 | /*----------- defined in video/cvs.c -----------*/ |
r18112 | r18113 | |
---|---|---|
46 | 46 | virtual void video_start(); |
47 | 47 | UINT32 screen_update_gijoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
48 | 48 | INTERRUPT_GEN_MEMBER(gijoe_interrupt); |
49 | TIMER_CALLBACK_MEMBER(dmaend_callback); | |
49 | 50 | }; |
50 | 51 | |
51 | 52 | /*----------- defined in video/gijoe.c -----------*/ |
r18112 | r18113 | |
---|---|---|
65 | 65 | void screen_eof_twin16(screen_device &screen, bool state); |
66 | 66 | INTERRUPT_GEN_MEMBER(CPUA_interrupt); |
67 | 67 | INTERRUPT_GEN_MEMBER(CPUB_interrupt); |
68 | TIMER_CALLBACK_MEMBER(twin16_sprite_tick); | |
68 | 69 | }; |
69 | 70 | |
70 | 71 | /*----------- defined in drivers/twin16.c -----------*/ |
r18112 | r18113 | |
---|---|---|
40 | 40 | virtual void machine_reset(); |
41 | 41 | virtual void video_start(); |
42 | 42 | UINT32 screen_update_rpunch(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
43 | TIMER_CALLBACK_MEMBER(sound_command_w_callback); | |
44 | TIMER_CALLBACK_MEMBER(crtc_interrupt_gen); | |
43 | 45 | }; |
r18112 | r18113 | |
---|---|---|
59 | 59 | virtual void machine_reset(); |
60 | 60 | virtual void video_start(); |
61 | 61 | UINT32 screen_update_cloud9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
62 | TIMER_CALLBACK_MEMBER(clock_irq); | |
62 | 63 | }; |
r18112 | r18113 | |
---|---|---|
41 | 41 | virtual void machine_reset(); |
42 | 42 | UINT32 screen_update_simpsons(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
43 | 43 | INTERRUPT_GEN_MEMBER(simpsons_irq); |
44 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
45 | TIMER_CALLBACK_MEMBER(dmaend_callback); | |
44 | 46 | }; |
45 | 47 | |
46 | 48 | /*----------- defined in machine/simpsons.c -----------*/ |
r18112 | r18113 | |
---|---|---|
78 | 78 | DECLARE_PALETTE_INIT(rjammer); |
79 | 79 | UINT32 screen_update_tubep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
80 | 80 | UINT32 screen_update_rjammer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
81 | TIMER_CALLBACK_MEMBER(tubep_scanline_callback); | |
82 | TIMER_CALLBACK_MEMBER(rjammer_scanline_callback); | |
83 | TIMER_CALLBACK_MEMBER(sprite_timer_callback); | |
81 | 84 | }; |
82 | 85 | |
83 | 86 |
r18112 | r18113 | |
---|---|---|
58 | 58 | DECLARE_MACHINE_RESET(namcofl); |
59 | 59 | DECLARE_VIDEO_START(namcofl); |
60 | 60 | UINT32 screen_update_namcofl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
61 | TIMER_CALLBACK_MEMBER(network_interrupt_callback); | |
62 | TIMER_CALLBACK_MEMBER(vblank_interrupt_callback); | |
63 | TIMER_CALLBACK_MEMBER(raster_interrupt_callback); | |
61 | 64 | }; |
r18112 | r18113 | |
---|---|---|
69 | 69 | DECLARE_MACHINE_START(teetert); |
70 | 70 | UINT32 screen_update_exidy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
71 | 71 | INTERRUPT_GEN_MEMBER(exidy_vblank_interrupt); |
72 | TIMER_CALLBACK_MEMBER(collision_irq_callback); | |
72 | 73 | }; |
73 | 74 | |
74 | 75 | /*----------- defined in video/exidy.c -----------*/ |
r18112 | r18113 | |
---|---|---|
24 | 24 | DECLARE_DRIVER_INIT(hyhoo); |
25 | 25 | virtual void video_start(); |
26 | 26 | UINT32 screen_update_hyhoo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
27 | TIMER_CALLBACK_MEMBER(blitter_timer_callback); | |
27 | 28 | }; |
r18112 | r18113 | |
---|---|---|
44 | 44 | virtual void machine_reset(); |
45 | 45 | virtual void video_start(); |
46 | 46 | UINT32 screen_update_volfied(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
47 | TIMER_CALLBACK_MEMBER(volfied_timer_callback); | |
47 | 48 | }; |
48 | 49 | |
49 | 50 |
r18112 | r18113 | |
---|---|---|
144 | 144 | UINT32 screen_update_phantom2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
145 | 145 | UINT32 screen_update_invaders(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
146 | 146 | void screen_eof_phantom2(screen_device &screen, bool state); |
147 | TIMER_CALLBACK_MEMBER(maze_tone_timing_timer_callback); | |
148 | TIMER_CALLBACK_MEMBER(mw8080bw_interrupt_callback); | |
147 | 149 | }; |
148 | 150 | |
149 | 151 |
r18112 | r18113 | |
---|---|---|
159 | 159 | DECLARE_MACHINE_RESET(drivedge); |
160 | 160 | UINT32 screen_update_itech32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
161 | 161 | INTERRUPT_GEN_MEMBER(generate_int1); |
162 | TIMER_CALLBACK_MEMBER(delayed_sound_data_w); | |
163 | TIMER_CALLBACK_MEMBER(scanline_interrupt); | |
162 | 164 | }; |
163 | 165 | |
164 | 166 | /*----------- defined in drivers/itech32.c -----------*/ |
r18112 | r18113 | |
---|---|---|
111 | 111 | virtual void machine_start(); |
112 | 112 | virtual void machine_reset(); |
113 | 113 | INTERRUPT_GEN_MEMBER(vertigo_interrupt); |
114 | TIMER_CALLBACK_MEMBER(sound_command_w); | |
114 | 115 | }; |
115 | 116 | |
116 | 117 | /*----------- defined in machine/vertigo.c -----------*/ |
r18112 | r18113 | |
---|---|---|
59 | 59 | UINT32 screen_update_midzeus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
60 | 60 | UINT32 screen_update_midzeus2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
61 | 61 | INTERRUPT_GEN_MEMBER(display_irq); |
62 | TIMER_CALLBACK_MEMBER(display_irq_off); | |
63 | TIMER_CALLBACK_MEMBER(invasn_gun_callback); | |
62 | 64 | }; |
63 | 65 | |
64 | 66 | /*----------- defined in video/midzeus2.c -----------*/ |
r18112 | r18113 | |
---|---|---|
117 | 117 | DECLARE_MACHINE_RESET(common); |
118 | 118 | UINT32 screen_update_gaelco3d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
119 | 119 | INTERRUPT_GEN_MEMBER(vblank_gen); |
120 | TIMER_CALLBACK_MEMBER(delayed_sound_w); | |
120 | 121 | }; |
121 | 122 | |
122 | 123 | /*----------- defined in video/gaelco3d.c -----------*/ |
r18112 | r18113 | |
---|---|---|
51 | 51 | virtual void video_start(); |
52 | 52 | virtual void palette_init(); |
53 | 53 | UINT32 screen_update_dday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
54 | TIMER_CALLBACK_MEMBER(countdown_timer_callback); | |
54 | 55 | }; |
r18112 | r18113 | |
---|---|---|
74 | 74 | UINT32 screen_update_grchamp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
75 | 75 | INTERRUPT_GEN_MEMBER(grchamp_cpu0_interrupt); |
76 | 76 | INTERRUPT_GEN_MEMBER(grchamp_cpu1_interrupt); |
77 | TIMER_CALLBACK_MEMBER(main_to_sub_comm_sync_w); | |
77 | 78 | }; |
78 | 79 | |
79 | 80 | /* Discrete Sound Input Nodes */ |
r18112 | r18113 | |
---|---|---|
90 | 90 | DECLARE_VIDEO_START(magerror_14220); |
91 | 91 | DECLARE_VIDEO_START(common_14220); |
92 | 92 | UINT32 screen_update_hyprduel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
93 | TIMER_CALLBACK_MEMBER(vblank_end_callback); | |
94 | TIMER_CALLBACK_MEMBER(magerror_irq_callback); | |
95 | TIMER_CALLBACK_MEMBER(hyprduel_blit_done); | |
93 | 96 | }; |
r18112 | r18113 | |
---|---|---|
79 | 79 | UINT32 screen_update_namconb2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
80 | 80 | INTERRUPT_GEN_MEMBER(namconb1_interrupt); |
81 | 81 | INTERRUPT_GEN_MEMBER(namconb2_interrupt); |
82 | TIMER_CALLBACK_MEMBER(namconb1_TriggerPOSIRQ); | |
83 | TIMER_CALLBACK_MEMBER(namconb2_TriggerPOSIRQ); | |
82 | 84 | }; |
r18112 | r18113 | |
---|---|---|
178 | 178 | void screen_eof_tx1(screen_device &screen, bool state); |
179 | 179 | void screen_eof_buggyboy(screen_device &screen, bool state); |
180 | 180 | INTERRUPT_GEN_MEMBER(z80_irq); |
181 | TIMER_CALLBACK_MEMBER(interrupt_callback); | |
181 | 182 | }; |
182 | 183 | |
183 | 184 | /*----------- defined in audio/tx1.c -----------*/ |
r18112 | r18113 | |
---|---|---|
62 | 62 | DECLARE_DRIVER_INIT(mhavocrv); |
63 | 63 | virtual void machine_start(); |
64 | 64 | virtual void machine_reset(); |
65 | TIMER_CALLBACK_MEMBER(delayed_gamma_w); | |
65 | 66 | }; |
66 | 67 | |
67 | 68 | /*----------- defined in machine/mhavoc.c -----------*/ |
r18112 | r18113 | |
---|---|---|
40 | 40 | virtual void palette_init(); |
41 | 41 | UINT32 screen_update_sprint4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
42 | 42 | void screen_eof_sprint4(screen_device &screen, bool state); |
43 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
43 | 44 | }; |
r18112 | r18113 | |
---|---|---|
35 | 35 | DECLARE_WRITE8_MEMBER(ym2151_data_latch_w); |
36 | 36 | DECLARE_WRITE8_MEMBER(sound_slave_dac_w); |
37 | 37 | virtual void palette_init(); |
38 | TIMER_CALLBACK_MEMBER(sound_delayed_w); | |
38 | 39 | }; |
39 | 40 | |
40 | 41 | /*----------- defined in video/exterm.c -----------*/ |
r18112 | r18113 | |
---|---|---|
119 | 119 | UINT32 screen_update_majtitle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
120 | 120 | INTERRUPT_GEN_MEMBER(m72_mcu_int); |
121 | 121 | INTERRUPT_GEN_MEMBER(fake_nmi); |
122 | TIMER_CALLBACK_MEMBER(synch_callback); | |
123 | TIMER_CALLBACK_MEMBER(m72_scanline_interrupt); | |
124 | TIMER_CALLBACK_MEMBER(kengo_scanline_interrupt); | |
125 | TIMER_CALLBACK_MEMBER(delayed_ram16_w); | |
122 | 126 | }; |
r18112 | r18113 | |
---|---|---|
101 | 101 | UINT32 screen_update_segag80r(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
102 | 102 | INTERRUPT_GEN_MEMBER(segag80r_vblank_start); |
103 | 103 | INTERRUPT_GEN_MEMBER(sindbadm_vblank_start); |
104 | TIMER_CALLBACK_MEMBER(vblank_latch_clear); | |
104 | 105 | }; |
105 | 106 | |
106 | 107 |
r18112 | r18113 | |
---|---|---|
50 | 50 | INTERRUPT_GEN_MEMBER(gaplus_vblank_main_irq); |
51 | 51 | INTERRUPT_GEN_MEMBER(gaplus_vblank_sub_irq); |
52 | 52 | INTERRUPT_GEN_MEMBER(gaplus_vblank_sub2_irq); |
53 | TIMER_CALLBACK_MEMBER(namcoio_run); | |
53 | 54 | }; |
r18112 | r18113 | |
---|---|---|
47 | 47 | TILE_GET_INFO_MEMBER(get_fg_tile_info); |
48 | 48 | virtual void video_start(); |
49 | 49 | UINT32 screen_update_tehkanwc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
50 | TIMER_CALLBACK_MEMBER(reset_callback); | |
50 | 51 | }; |
r18112 | r18113 | |
---|---|---|
51 | 51 | UINT32 screen_update_asuka(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
52 | 52 | void screen_eof_asuka(screen_device &screen, bool state); |
53 | 53 | INTERRUPT_GEN_MEMBER(cadash_interrupt); |
54 | TIMER_CALLBACK_MEMBER(cadash_interrupt5); | |
54 | 55 | }; |
55 | 56 | |
56 | 57 | /*----------- defined in machine/bonzeadv.c -----------*/ |
r18112 | r18113 | |
---|---|---|
42 | 42 | virtual void palette_init(); |
43 | 43 | UINT32 screen_update_suprridr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
44 | 44 | INTERRUPT_GEN_MEMBER(main_nmi_gen); |
45 | TIMER_CALLBACK_MEMBER(delayed_sound_w); | |
45 | 46 | }; |
46 | 47 | |
47 | 48 | /*----------- defined in video/suprridr.c -----------*/ |
r18112 | r18113 | |
---|---|---|
84 | 84 | INTERRUPT_GEN_MEMBER(selfeena_interrupt); |
85 | 85 | INTERRUPT_GEN_MEMBER(sbm_interrupt); |
86 | 86 | INTERRUPT_GEN_MEMBER(realpunc_interrupt); |
87 | TIMER_CALLBACK_MEMBER(rsaga2_interrupt2); | |
88 | TIMER_CALLBACK_MEMBER(crimec_interrupt3); | |
89 | TIMER_CALLBACK_MEMBER(hitice_interrupt6); | |
90 | TIMER_CALLBACK_MEMBER(rambo3_interrupt1); | |
91 | TIMER_CALLBACK_MEMBER(pbobble_interrupt5); | |
92 | TIMER_CALLBACK_MEMBER(viofight_interrupt1); | |
93 | TIMER_CALLBACK_MEMBER(masterw_interrupt4); | |
94 | TIMER_CALLBACK_MEMBER(silentd_interrupt4); | |
95 | TIMER_CALLBACK_MEMBER(selfeena_interrupt4); | |
96 | TIMER_CALLBACK_MEMBER(sbm_interrupt5); | |
97 | TIMER_CALLBACK_MEMBER(realpunc_interrupt3); | |
87 | 98 | }; |
r18112 | r18113 | |
---|---|---|
71 | 71 | UINT32 screen_update_gameplan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
72 | 72 | UINT32 screen_update_leprechn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
73 | 73 | INTERRUPT_GEN_MEMBER(trvquest_interrupt); |
74 | TIMER_CALLBACK_MEMBER(clear_screen_done_callback); | |
75 | TIMER_CALLBACK_MEMBER(via_irq_delayed); | |
76 | TIMER_CALLBACK_MEMBER(via_0_ca1_timer_callback); | |
74 | 77 | }; |
75 | 78 | |
76 | 79 | /*----------- defined in video/gameplan.c -----------*/ |
r18112 | r18113 | |
---|---|---|
40 | 40 | DECLARE_VIDEO_START(qdrmfgp2); |
41 | 41 | UINT32 screen_update_qdrmfgp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
42 | 42 | INTERRUPT_GEN_MEMBER(qdrmfgp2_interrupt); |
43 | TIMER_CALLBACK_MEMBER(gp2_timer_callback); | |
43 | 44 | }; |
44 | 45 | |
45 | 46 | /*----------- defined in video/qdrmfgp.c -----------*/ |
r18112 | r18113 | |
---|---|---|
21 | 21 | DECLARE_MACHINE_RESET(skullxbo); |
22 | 22 | DECLARE_VIDEO_START(skullxbo); |
23 | 23 | UINT32 screen_update_skullxbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
24 | TIMER_CALLBACK_MEMBER(irq_gen); | |
24 | 25 | }; |
25 | 26 | |
26 | 27 | /*----------- defined in video/skullxbo.c -----------*/ |
r18112 | r18113 | |
---|---|---|
131 | 131 | INTERRUPT_GEN_MEMBER(toaplan2_vblank_irq2); |
132 | 132 | INTERRUPT_GEN_MEMBER(toaplan2_vblank_irq4); |
133 | 133 | INTERRUPT_GEN_MEMBER(bbakraid_snd_interrupt); |
134 | TIMER_CALLBACK_MEMBER(toaplan2_raise_irq); | |
134 | 135 | }; |
r18112 | r18113 | |
---|---|---|
29 | 29 | DECLARE_DRIVER_INIT(ripribit); |
30 | 30 | DECLARE_DRIVER_INIT(cclownz); |
31 | 31 | virtual void video_start(); |
32 | TIMER_CALLBACK_MEMBER(gen_ext1_int); | |
32 | 33 | }; |
33 | 34 | |
34 | 35 | /*----------- defined in video/lethalj.c -----------*/ |
r18112 | r18113 | |
---|---|---|
47 | 47 | virtual void video_start(); |
48 | 48 | virtual void palette_init(); |
49 | 49 | UINT32 screen_update_fgoal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
50 | TIMER_CALLBACK_MEMBER(interrupt_callback); | |
50 | 51 | }; |
r18112 | r18113 | |
---|---|---|
44 | 44 | virtual void palette_init(); |
45 | 45 | UINT32 screen_update_tankbust(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
46 | 46 | INTERRUPT_GEN_MEMBER(vblank_irq); |
47 | TIMER_CALLBACK_MEMBER(soundlatch_callback); | |
48 | TIMER_CALLBACK_MEMBER(soundirqline_callback); | |
47 | 49 | }; |
r18112 | r18113 | |
---|---|---|
117 | 117 | UINT32 screen_update_flstory(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
118 | 118 | UINT32 screen_update_victnine(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
119 | 119 | UINT32 screen_update_rumba(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
120 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
120 | 121 | }; |
r18112 | r18113 | |
---|---|---|
49 | 49 | virtual void video_start(); |
50 | 50 | UINT32 screen_update_galastrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
51 | 51 | INTERRUPT_GEN_MEMBER(galastrm_interrupt); |
52 | TIMER_CALLBACK_MEMBER(galastrm_interrupt6); | |
52 | 53 | }; |
r18112 | r18113 | |
---|---|---|
32 | 32 | virtual void machine_reset(); |
33 | 33 | virtual void video_start(); |
34 | 34 | UINT32 screen_update_atetris(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
35 | TIMER_CALLBACK_MEMBER(interrupt_gen); | |
35 | 36 | }; |
r18112 | r18113 | |
---|---|---|
110 | 110 | UINT32 screen_update_rockntread(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
111 | 111 | UINT32 screen_update_rocknms_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
112 | 112 | UINT32 screen_update_rocknms_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
113 | TIMER_CALLBACK_MEMBER(rockn_timer_level4_callback); | |
114 | TIMER_CALLBACK_MEMBER(rockn_timer_sub_level4_callback); | |
115 | TIMER_CALLBACK_MEMBER(rockn_timer_level1_callback); | |
116 | TIMER_CALLBACK_MEMBER(rockn_timer_sub_level1_callback); | |
113 | 117 | }; |
114 | 118 | |
115 | 119 | class stepstag_state : public tetrisp2_state |
r18112 | r18113 | |
---|---|---|
44 | 44 | DECLARE_DRIVER_INIT(fireone); |
45 | 45 | virtual void video_start(); |
46 | 46 | UINT32 screen_update_starfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
47 | TIMER_CALLBACK_MEMBER(starfire_scanline_callback); | |
47 | 48 | }; |
r18112 | r18113 | |
---|---|---|
52 | 52 | DECLARE_VIDEO_START(powerbls); |
53 | 53 | UINT32 screen_update_sslam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
54 | 54 | UINT32 screen_update_powerbls(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
55 | TIMER_CALLBACK_MEMBER(music_playback); | |
55 | 56 | }; |
r18112 | r18113 | |
---|---|---|
258 | 258 | UINT32 screen_update_namcos22(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
259 | 259 | INTERRUPT_GEN_MEMBER(namcos22s_interrupt); |
260 | 260 | INTERRUPT_GEN_MEMBER(namcos22_interrupt); |
261 | TIMER_CALLBACK_MEMBER(alpine_steplock_callback); | |
261 | 262 | }; |
262 | 263 | |
263 | 264 | /*----------- defined in video/namcos22.c -----------*/ |
r18112 | r18113 | |
---|---|---|
180 | 180 | UINT32 screen_update_dambustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
181 | 181 | INTERRUPT_GEN_MEMBER(vblank_irq); |
182 | 182 | INTERRUPT_GEN_MEMBER(hunchbks_vh_interrupt); |
183 | TIMER_CALLBACK_MEMBER(stars_blink_callback); | |
184 | TIMER_CALLBACK_MEMBER(stars_scroll_callback); | |
183 | 185 | }; |
184 | 186 | |
185 | 187 | /*----------- defined in video/galaxold.c -----------*/ |
r18112 | r18113 | |
---|---|---|
202 | 202 | DECLARE_PALETTE_INIT(sailormn); |
203 | 203 | UINT32 screen_update_cave(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
204 | 204 | INTERRUPT_GEN_MEMBER(cave_interrupt); |
205 | TIMER_CALLBACK_MEMBER(cave_vblank_end); | |
205 | 206 | }; |
206 | 207 | |
207 | 208 | /*----------- defined in video/cave.c -----------*/ |
r18112 | r18113 | |
---|---|---|
45 | 45 | virtual void video_start(); |
46 | 46 | UINT32 screen_update_orbit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
47 | 47 | INTERRUPT_GEN_MEMBER(orbit_interrupt); |
48 | TIMER_CALLBACK_MEMBER(irq_off); | |
48 | 49 | }; |
49 | 50 | /*----------- defined in audio/orbit.c -----------*/ |
50 | 51 | DECLARE_WRITE8_DEVICE_HANDLER( orbit_note_w ); |
r18112 | r18113 | |
---|---|---|
132 | 132 | void screen_eof_dec8(screen_device &screen, bool state); |
133 | 133 | INTERRUPT_GEN_MEMBER(gondo_interrupt); |
134 | 134 | INTERRUPT_GEN_MEMBER(oscar_interrupt); |
135 | TIMER_CALLBACK_MEMBER(dec8_i8751_timer_callback); | |
135 | 136 | }; |
136 | 137 | |
137 | 138 | /*----------- defined in video/dec8.c -----------*/ |
r18112 | r18113 | |
---|---|---|
120 | 120 | virtual void video_start(); |
121 | 121 | DECLARE_MACHINE_RESET(midvplus); |
122 | 122 | UINT32 screen_update_midvunit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
123 | TIMER_CALLBACK_MEMBER(adc_ready); | |
124 | TIMER_CALLBACK_MEMBER(scanline_timer_cb); | |
123 | 125 | }; |
r18112 | r18113 | |
---|---|---|
53 | 53 | virtual void palette_init(); |
54 | 54 | UINT32 screen_update_pitnrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
55 | 55 | INTERRUPT_GEN_MEMBER(pitnrun_nmi_source); |
56 | TIMER_CALLBACK_MEMBER(pitnrun_mcu_real_data_r); | |
57 | TIMER_CALLBACK_MEMBER(pitnrun_mcu_real_data_w); | |
58 | TIMER_CALLBACK_MEMBER(pitnrun_mcu_data_real_r); | |
59 | TIMER_CALLBACK_MEMBER(pitnrun_mcu_status_real_w); | |
56 | 60 | }; |
r18112 | r18113 | |
---|---|---|
75 | 75 | DECLARE_WRITE32_MEMBER( dd_reg_w ); |
76 | 76 | DECLARE_READ32_MEMBER( pif_ram_r ); |
77 | 77 | DECLARE_WRITE32_MEMBER( pif_ram_w ); |
78 | TIMER_CALLBACK_MEMBER(reset_timer_callback); | |
79 | TIMER_CALLBACK_MEMBER(vi_scanline_callback); | |
80 | TIMER_CALLBACK_MEMBER(ai_timer_callback); | |
81 | TIMER_CALLBACK_MEMBER(pi_dma_callback); | |
78 | 82 | |
79 | 83 | UINT32 sp_reg_r(UINT32 offset); |
80 | 84 | void sp_reg_w(UINT32 offset, UINT32 data, UINT32 mem_mask); |
r18112 | r18113 | |
---|---|---|
90 | 90 | virtual void machine_reset(); |
91 | 91 | virtual void video_start(); |
92 | 92 | UINT32 screen_update_bigevglf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
93 | TIMER_CALLBACK_MEMBER(from_sound_latch_callback); | |
94 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
95 | TIMER_CALLBACK_MEMBER(deferred_ls74_w); | |
93 | 96 | }; |
r18112 | r18113 | |
---|---|---|
42 | 42 | virtual void video_start(); |
43 | 43 | UINT32 screen_update_capbowl(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
44 | 44 | INTERRUPT_GEN_MEMBER(capbowl_interrupt); |
45 | TIMER_CALLBACK_MEMBER(capbowl_update); | |
45 | 46 | }; |
r18112 | r18113 | |
---|---|---|
56 | 56 | UINT32 screen_update_moo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
57 | 57 | INTERRUPT_GEN_MEMBER(moo_interrupt); |
58 | 58 | INTERRUPT_GEN_MEMBER(moobl_interrupt); |
59 | TIMER_CALLBACK_MEMBER(dmaend_callback); | |
59 | 60 | }; |
60 | 61 | |
61 | 62 | /*----------- defined in video/moo.c -----------*/ |
r18112 | r18113 | |
---|---|---|
80 | 80 | DECLARE_VIDEO_START(atarisy2); |
81 | 81 | UINT32 screen_update_atarisy2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
82 | 82 | INTERRUPT_GEN_MEMBER(vblank_int); |
83 | TIMER_CALLBACK_MEMBER(delayed_int_enable_w); | |
84 | TIMER_CALLBACK_MEMBER(reset_yscroll_callback); | |
83 | 85 | }; |
84 | 86 | |
85 | 87 |
r18112 | r18113 | |
---|---|---|
77 | 77 | DECLARE_VIDEO_START(ppan); |
78 | 78 | UINT32 screen_update_m92(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
79 | 79 | UINT32 screen_update_ppan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
80 | TIMER_CALLBACK_MEMBER(spritebuffer_callback); | |
80 | 81 | }; |
81 | 82 | |
82 | 83 | /*----------- defined in drivers/m92.c -----------*/ |
r18112 | r18113 | |
---|---|---|
436 | 436 | DECLARE_VIDEO_START(amiga_aga); |
437 | 437 | UINT32 screen_update_amiga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
438 | 438 | UINT32 screen_update_amiga_aga(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
439 | TIMER_CALLBACK_MEMBER(scanline_callback); | |
440 | TIMER_CALLBACK_MEMBER(amiga_irq_proc); | |
441 | TIMER_CALLBACK_MEMBER(amiga_blitter_proc); | |
442 | TIMER_CALLBACK_MEMBER(finish_serial_write); | |
439 | 443 | }; |
440 | 444 | |
441 | 445 |
r18112 | r18113 | |
---|---|---|
74 | 74 | virtual void video_start(); |
75 | 75 | DECLARE_VIDEO_START(nbmj8891_1layer); |
76 | 76 | UINT32 screen_update_nbmj8891(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
77 | TIMER_CALLBACK_MEMBER(blitter_timer_callback); | |
77 | 78 | }; |
r18112 | r18113 | |
---|---|---|
83 | 83 | virtual void machine_reset(); |
84 | 84 | virtual void video_start(); |
85 | 85 | UINT32 screen_update_lkage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
86 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
86 | 87 | }; |
r18112 | r18113 | |
---|---|---|
95 | 95 | UINT32 screen_update_itech8_2page(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
96 | 96 | UINT32 screen_update_itech8_2page_large(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
97 | 97 | INTERRUPT_GEN_MEMBER(generate_nmi); |
98 | TIMER_CALLBACK_MEMBER(irq_off); | |
99 | TIMER_CALLBACK_MEMBER(behind_the_beam_update); | |
100 | TIMER_CALLBACK_MEMBER(delayed_sound_data_w); | |
101 | TIMER_CALLBACK_MEMBER(blitter_done); | |
98 | 102 | }; |
99 | 103 | |
100 | 104 |
r18112 | r18113 | |
---|---|---|
35 | 35 | virtual void video_start(); |
36 | 36 | virtual void palette_init(); |
37 | 37 | UINT32 screen_update_pastelg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
38 | TIMER_CALLBACK_MEMBER(blitter_timer_callback); | |
38 | 39 | }; |
39 | 40 | |
40 | 41 | /*----------- defined in video/pastelg.c -----------*/ |
r18112 | r18113 | |
---|---|---|
101 | 101 | DECLARE_VIDEO_START(mcr); |
102 | 102 | DECLARE_MACHINE_START(nflfoot); |
103 | 103 | UINT32 screen_update_mcr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
104 | TIMER_CALLBACK_MEMBER(ipu_watchdog_reset); | |
104 | 105 | }; |
105 | 106 | |
106 | 107 |
r18112 | r18113 | |
---|---|---|
78 | 78 | UINT32 screen_update_vicdual_bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
79 | 79 | UINT32 screen_update_vicdual_bw_or_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
80 | 80 | UINT32 screen_update_vicdual_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
81 | TIMER_CALLBACK_MEMBER(clear_coin_status); | |
81 | 82 | }; |
82 | 83 | |
83 | 84 | /*----------- defined in drivers/vicdual.c -----------*/ |
r18112 | r18113 | |
---|---|---|
143 | 143 | UINT32 screen_update_leland(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
144 | 144 | UINT32 screen_update_ataxx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
145 | 145 | INTERRUPT_GEN_MEMBER(leland_master_interrupt); |
146 | TIMER_CALLBACK_MEMBER(leland_interrupt_callback); | |
147 | TIMER_CALLBACK_MEMBER(ataxx_interrupt_callback); | |
148 | TIMER_CALLBACK_MEMBER(scanline_callback); | |
149 | TIMER_CALLBACK_MEMBER(leland_delayed_mvram_w); | |
146 | 150 | }; |
147 | 151 | |
148 | 152 |
r18112 | r18113 | |
---|---|---|
217 | 217 | UINT32 screen_update_spclforc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
218 | 218 | INTERRUPT_GEN_MEMBER(s2650_interrupt); |
219 | 219 | INTERRUPT_GEN_MEMBER(vblank_irq); |
220 | TIMER_CALLBACK_MEMBER(scanline_callback); | |
220 | 221 | }; |
221 | 222 | |
222 | 223 | /*----------- defined in audio/dkong.c -----------*/ |
r18112 | r18113 | |
---|---|---|
37 | 37 | virtual void palette_init(); |
38 | 38 | UINT32 screen_update_sprint8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
39 | 39 | void screen_eof_sprint8(screen_device &screen, bool state); |
40 | TIMER_CALLBACK_MEMBER(sprint8_collision_callback); | |
40 | 41 | }; |
41 | 42 | |
42 | 43 | /*----------- defined in drivers/sprint8.c -----------*/ |
r18112 | r18113 | |
---|---|---|
41 | 41 | virtual void video_start(); |
42 | 42 | UINT32 screen_update_bombjack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
43 | 43 | INTERRUPT_GEN_MEMBER(vblank_irq); |
44 | TIMER_CALLBACK_MEMBER(soundlatch_callback); | |
44 | 45 | }; |
r18112 | r18113 | |
---|---|---|
60 | 60 | virtual void video_start(); |
61 | 61 | UINT32 screen_update_gcpinbal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
62 | 62 | INTERRUPT_GEN_MEMBER(gcpinbal_interrupt); |
63 | TIMER_CALLBACK_MEMBER(gcpinbal_interrupt1); | |
64 | TIMER_CALLBACK_MEMBER(gcpinbal_interrupt3); | |
63 | 65 | }; |
r18112 | r18113 | |
---|---|---|
122 | 122 | DECLARE_PALETTE_INIT(profpac); |
123 | 123 | UINT32 screen_update_astrocde(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
124 | 124 | UINT32 screen_update_profpac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
125 | TIMER_CALLBACK_MEMBER(interrupt_off); | |
126 | TIMER_CALLBACK_MEMBER(scanline_callback); | |
125 | 127 | }; |
126 | 128 | |
127 | 129 | /*----------- defined in audio/wow.c -----------*/ |
r18112 | r18113 | |
---|---|---|
77 | 77 | virtual void machine_reset(); |
78 | 78 | DECLARE_VIDEO_START(jedi); |
79 | 79 | UINT32 screen_update_jedi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
80 | TIMER_CALLBACK_MEMBER(generate_interrupt); | |
80 | 81 | }; |
81 | 82 | |
82 | 83 | /*----------- defined in audio/jedi.c -----------*/ |
r18112 | r18113 | |
---|---|---|
92 | 92 | UINT32 screen_update_psikyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
93 | 93 | UINT32 screen_update_psikyo_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
94 | 94 | void screen_eof_psikyo(screen_device &screen, bool state); |
95 | TIMER_CALLBACK_MEMBER(psikyo_soundlatch_callback); | |
95 | 96 | }; |
96 | 97 | |
97 | 98 | /*----------- defined in video/psikyo.c -----------*/ |
r18112 | r18113 | |
---|---|---|
198 | 198 | DECLARE_MACHINE_START(model3_21); |
199 | 199 | DECLARE_MACHINE_RESET(model3_21); |
200 | 200 | UINT32 screen_update_model3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
201 | TIMER_CALLBACK_MEMBER(model3_sound_timer_tick); | |
201 | 202 | }; |
202 | 203 | |
203 | 204 |
r18112 | r18113 | |
---|---|---|
90 | 90 | UINT32 screen_update_mbmj8688(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
91 | 91 | UINT32 screen_update_mbmj8688_lcd0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
92 | 92 | UINT32 screen_update_mbmj8688_lcd1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
93 | TIMER_CALLBACK_MEMBER(blitter_timer_callback); | |
93 | 94 | }; |
r18112 | r18113 | |
---|---|---|
61 | 61 | virtual void palette_init(); |
62 | 62 | UINT32 screen_update_tank8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
63 | 63 | void screen_eof_tank8(screen_device &screen, bool state); |
64 | TIMER_CALLBACK_MEMBER(tank8_collision_callback); | |
64 | 65 | }; |
65 | 66 | |
66 | 67 | /*----------- defined in audio/tank8.c -----------*/ |
r18112 | r18113 | |
---|---|---|
64 | 64 | virtual void video_start(); |
65 | 65 | UINT32 screen_update_othunder(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
66 | 66 | INTERRUPT_GEN_MEMBER(vblank_interrupt); |
67 | TIMER_CALLBACK_MEMBER(ad_interrupt); | |
67 | 68 | }; |
r18112 | r18113 | |
---|---|---|
91 | 91 | INTERRUPT_GEN_MEMBER(m11_interrupt); |
92 | 92 | INTERRUPT_GEN_MEMBER(m10_interrupt); |
93 | 93 | INTERRUPT_GEN_MEMBER(m15_interrupt); |
94 | TIMER_CALLBACK_MEMBER(interrupt_callback); | |
94 | 95 | }; |
95 | 96 |
r18112 | r18113 | |
---|---|---|
67 | 67 | UINT32 screen_update_slapshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
68 | 68 | void screen_eof_taito_no_buffer(screen_device &screen, bool state); |
69 | 69 | INTERRUPT_GEN_MEMBER(slapshot_interrupt); |
70 | TIMER_CALLBACK_MEMBER(slapshot_interrupt6); | |
70 | 71 | }; |
71 | 72 |
r18112 | r18113 | |
---|---|---|
32 | 32 | INPUT_CHANGED_MEMBER(cchasm_set_coin_flag); |
33 | 33 | DECLARE_WRITE_LINE_MEMBER(cchasm_6840_irq); |
34 | 34 | virtual void video_start(); |
35 | TIMER_CALLBACK_MEMBER(cchasm_refresh_end); | |
35 | 36 | }; |
36 | 37 | |
37 | 38 | /*----------- defined in audio/cchasm.c -----------*/ |
r18112 | r18113 | |
---|---|---|
50 | 50 | virtual void machine_reset(); |
51 | 51 | virtual void video_start(); |
52 | 52 | UINT32 screen_update_spacefb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
53 | TIMER_CALLBACK_MEMBER(interrupt_callback); | |
53 | 54 | }; |
54 | 55 | |
55 | 56 | /*----------- defined in audio/spacefb.c -----------*/ |
r18112 | r18113 | |
---|---|---|
59 | 59 | DECLARE_VIDEO_START(toucheme); |
60 | 60 | DECLARE_VIDEO_START(ladyfrog_common); |
61 | 61 | UINT32 screen_update_ladyfrog(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
62 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
62 | 63 | }; |
r18112 | r18113 | |
---|---|---|
94 | 94 | virtual void video_start(); |
95 | 95 | UINT32 screen_update_esripsys(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
96 | 96 | INTERRUPT_GEN_MEMBER(esripsys_vblank_irq); |
97 | TIMER_CALLBACK_MEMBER(delayed_bank_swap); | |
98 | TIMER_CALLBACK_MEMBER(hblank_start_callback); | |
99 | TIMER_CALLBACK_MEMBER(hblank_end_callback); | |
97 | 100 | }; |
98 | 101 | |
99 | 102 |
r18112 | r18113 | |
---|---|---|
53 | 53 | virtual void video_start(); |
54 | 54 | UINT32 screen_update_nbmj8991_type1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
55 | 55 | UINT32 screen_update_nbmj8991_type2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
56 | TIMER_CALLBACK_MEMBER(blitter_timer_callback); | |
56 | 57 | }; |
r18112 | r18113 | |
---|---|---|
70 | 70 | UINT32 screen_update_exidy440(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
71 | 71 | UINT32 screen_update_topsecex(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
72 | 72 | INTERRUPT_GEN_MEMBER(exidy440_vblank_interrupt); |
73 | TIMER_CALLBACK_MEMBER(delayed_sound_command_w); | |
74 | TIMER_CALLBACK_MEMBER(beam_firq_callback); | |
75 | TIMER_CALLBACK_MEMBER(collide_firq_callback); | |
73 | 76 | }; |
74 | 77 | |
75 | 78 |
r18112 | r18113 | |
---|---|---|
22 | 22 | DECLARE_MACHINE_RESET(blstroid); |
23 | 23 | DECLARE_VIDEO_START(blstroid); |
24 | 24 | UINT32 screen_update_blstroid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
25 | TIMER_CALLBACK_MEMBER(irq_off); | |
26 | TIMER_CALLBACK_MEMBER(irq_on); | |
25 | 27 | }; |
26 | 28 | |
27 | 29 |
r18112 | r18113 | |
---|---|---|
218 | 218 | DECLARE_MACHINE_RESET(harddriv); |
219 | 219 | DECLARE_VIDEO_START(harddriv); |
220 | 220 | INTERRUPT_GEN_MEMBER(hd68k_irq_gen); |
221 | TIMER_CALLBACK_MEMBER(deferred_adsp_bank_switch); | |
222 | TIMER_CALLBACK_MEMBER(rddsp32_sync_cb); | |
221 | 223 | }; |
222 | 224 | |
223 | 225 |
r18112 | r18113 | |
---|---|---|
23 | 23 | virtual void palette_init(); |
24 | 24 | UINT32 screen_update_trucocl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
25 | 25 | INTERRUPT_GEN_MEMBER(trucocl_interrupt); |
26 | TIMER_CALLBACK_MEMBER(dac_irq); | |
26 | 27 | }; |
r18112 | r18113 | |
---|---|---|
56 | 56 | virtual void video_start(); |
57 | 57 | virtual void palette_init(); |
58 | 58 | UINT32 screen_update_gridlee(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
59 | TIMER_CALLBACK_MEMBER(irq_off_tick); | |
60 | TIMER_CALLBACK_MEMBER(irq_timer_tick); | |
61 | TIMER_CALLBACK_MEMBER(firq_off_tick); | |
62 | TIMER_CALLBACK_MEMBER(firq_timer_tick); | |
59 | 63 | }; |
60 | 64 | |
61 | 65 |
r18112 | r18113 | |
---|---|---|
57 | 57 | UINT32 screen_update_topspeed(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
58 | 58 | INTERRUPT_GEN_MEMBER(topspeed_interrupt); |
59 | 59 | INTERRUPT_GEN_MEMBER(topspeed_cpub_interrupt); |
60 | TIMER_CALLBACK_MEMBER(topspeed_interrupt6); | |
61 | TIMER_CALLBACK_MEMBER(topspeed_cpub_interrupt6); | |
60 | 62 | }; |
r18112 | r18113 | |
---|---|---|
52 | 52 | DECLARE_MACHINE_RESET(thunderx); |
53 | 53 | UINT32 screen_update_scontra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
54 | 54 | INTERRUPT_GEN_MEMBER(scontra_interrupt); |
55 | TIMER_CALLBACK_MEMBER(thunderx_firq_callback); | |
55 | 56 | }; |
56 | 57 | |
57 | 58 |
r18112 | r18113 | |
---|---|---|
73 | 73 | virtual void machine_start(); |
74 | 74 | DECLARE_MACHINE_RESET(opwolf); |
75 | 75 | UINT32 screen_update_opwolf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
76 | TIMER_CALLBACK_MEMBER(opwolf_timer_callback); | |
77 | TIMER_CALLBACK_MEMBER(cchip_timer); | |
76 | 78 | }; |
77 | 79 | |
78 | 80 | /*----------- defined in machine/opwolf.c -----------*/ |
r18112 | r18113 | |
---|---|---|
45 | 45 | DECLARE_DRIVER_INIT(ohpaipee); |
46 | 46 | virtual void video_start(); |
47 | 47 | UINT32 screen_update_nbmj8900(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
48 | TIMER_CALLBACK_MEMBER(blitter_timer_callback); | |
48 | 49 | }; |
r18112 | r18113 | |
---|---|---|
42 | 42 | virtual void machine_reset(); |
43 | 43 | virtual void video_start(); |
44 | 44 | UINT32 screen_update_videopin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
45 | TIMER_CALLBACK_MEMBER(interrupt_callback); | |
45 | 46 | }; |
46 | 47 | |
47 | 48 | /*----------- defined in audio/videopin.c -----------*/ |
r18112 | r18113 | |
---|---|---|
63 | 63 | virtual void video_start(); |
64 | 64 | UINT32 screen_update_victory(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
65 | 65 | INTERRUPT_GEN_MEMBER(victory_vblank_interrupt); |
66 | TIMER_CALLBACK_MEMBER(bgcoll_irq_callback); | |
66 | 67 | }; |
r18112 | r18113 | |
---|---|---|
65 | 65 | virtual void machine_reset(); |
66 | 66 | virtual void video_start(); |
67 | 67 | UINT32 screen_update_xexex(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
68 | TIMER_CALLBACK_MEMBER(dmaend_callback); | |
68 | 69 | }; |
69 | 70 | |
70 | 71 | /*----------- defined in video/xexex.c -----------*/ |
r18112 | r18113 | |
---|---|---|
41 | 41 | virtual void palette_init(); |
42 | 42 | UINT32 screen_update_ultratnk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
43 | 43 | void screen_eof_ultratnk(screen_device &screen, bool state); |
44 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
44 | 45 | }; |
r18112 | r18113 | |
---|---|---|
41 | 41 | virtual void video_start(); |
42 | 42 | UINT32 screen_update_gunbustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
43 | 43 | INTERRUPT_GEN_MEMBER(gunbustr_interrupt); |
44 | TIMER_CALLBACK_MEMBER(gunbustr_interrupt5); | |
44 | 45 | }; |
r18112 | r18113 | |
---|---|---|
90 | 90 | virtual void video_start(); |
91 | 91 | UINT32 screen_update_taitosj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
92 | 92 | UINT32 screen_update_kikstart(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
93 | TIMER_CALLBACK_MEMBER(taitosj_mcu_real_data_w); | |
94 | TIMER_CALLBACK_MEMBER(taitosj_mcu_data_real_r); | |
95 | TIMER_CALLBACK_MEMBER(taitosj_mcu_status_real_w); | |
93 | 96 | }; |
94 | 97 |
r18112 | r18113 | |
---|---|---|
80 | 80 | UINT32 screen_update_superqix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
81 | 81 | INTERRUPT_GEN_MEMBER(vblank_irq); |
82 | 82 | INTERRUPT_GEN_MEMBER(sqix_timer_irq); |
83 | TIMER_CALLBACK_MEMBER(mcu_acknowledge_callback); | |
84 | TIMER_CALLBACK_MEMBER(delayed_z80_mcu_w); | |
85 | TIMER_CALLBACK_MEMBER(delayed_mcu_z80_w); | |
83 | 86 | }; |
r18112 | r18113 | |
---|---|---|
48 | 48 | virtual void video_start(); |
49 | 49 | UINT32 screen_update_rltennis(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
50 | 50 | INTERRUPT_GEN_MEMBER(rltennis_interrupt); |
51 | TIMER_CALLBACK_MEMBER(sample_player); | |
51 | 52 | }; |
r18112 | r18113 | |
---|---|---|
181 | 181 | INTERRUPT_GEN_MEMBER(namcos2_68k_master_vblank); |
182 | 182 | INTERRUPT_GEN_MEMBER(namcos2_68k_slave_vblank); |
183 | 183 | INTERRUPT_GEN_MEMBER(namcos2_68k_gpu_vblank); |
184 | TIMER_CALLBACK_MEMBER(namcos2_posirq_tick); | |
184 | 185 | }; |
185 | 186 | |
186 | 187 | class namcos2_state : public namcos2_shared_state |
r18112 | r18113 | |
---|---|---|
34 | 34 | virtual void video_start(); |
35 | 35 | virtual void palette_init(); |
36 | 36 | UINT32 screen_update_magmax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
37 | TIMER_CALLBACK_MEMBER(scanline_callback); | |
37 | 38 | }; |
r18112 | r18113 | |
---|---|---|
86 | 86 | DECLARE_VIDEO_START(hatris); |
87 | 87 | UINT32 screen_update_fromance(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
88 | 88 | UINT32 screen_update_pipedrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
89 | TIMER_CALLBACK_MEMBER(deferred_commanddata_w); | |
90 | TIMER_CALLBACK_MEMBER(crtc_interrupt_gen); | |
89 | 91 | }; |
r18112 | r18113 | |
---|---|---|
21 | 21 | virtual void palette_init(); |
22 | 22 | UINT32 screen_update_mustache(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
23 | 23 | INTERRUPT_GEN_MEMBER(assert_irq); |
24 | TIMER_CALLBACK_MEMBER(clear_irq_cb); | |
24 | 25 | }; |
r18112 | r18113 | |
---|---|---|
80 | 80 | UINT32 screen_update_konamigx_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
81 | 81 | INTERRUPT_GEN_MEMBER(konamigx_vbinterrupt); |
82 | 82 | INTERRUPT_GEN_MEMBER(tms_sync); |
83 | TIMER_CALLBACK_MEMBER(dmaend_callback); | |
83 | 84 | }; |
84 | 85 | |
85 | 86 |
r18112 | r18113 | |
---|---|---|
144 | 144 | INTERRUPT_GEN_MEMBER(punkshot_interrupt); |
145 | 145 | INTERRUPT_GEN_MEMBER(lgtnfght_interrupt); |
146 | 146 | INTERRUPT_GEN_MEMBER(tmnt_vblank_irq); |
147 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
147 | 148 | }; |
148 | 149 | |
149 | 150 |
r18112 | r18113 | |
---|---|---|
166 | 166 | INTERRUPT_GEN_MEMBER(metro_periodic_interrupt); |
167 | 167 | INTERRUPT_GEN_MEMBER(karatour_interrupt); |
168 | 168 | INTERRUPT_GEN_MEMBER(puzzlet_interrupt); |
169 | TIMER_CALLBACK_MEMBER(karatour_irq_callback); | |
170 | TIMER_CALLBACK_MEMBER(mouja_irq_callback); | |
171 | TIMER_CALLBACK_MEMBER(metro_blit_done); | |
169 | 172 | }; |
170 | 173 | |
171 | 174 |
r18112 | r18113 | |
---|---|---|
44 | 44 | virtual void machine_reset(); |
45 | 45 | UINT32 screen_update_parodius(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
46 | 46 | INTERRUPT_GEN_MEMBER(parodius_interrupt); |
47 | TIMER_CALLBACK_MEMBER(nmi_callback); | |
47 | 48 | }; |
48 | 49 | |
49 | 50 | /*----------- defined in video/parodius.c -----------*/ |
r18112 | r18113 | |
---|---|---|
17 | 17 | * |
18 | 18 | *************************************/ |
19 | 19 | |
20 | static TIMER_CALLBACK( reset_yscroll_callback ); | |
21 | 20 | |
22 | 21 | |
23 | 22 | |
23 | ||
24 | 24 | /************************************* |
25 | 25 | * |
26 | 26 | * Tilemap callbacks |
r18112 | r18113 | |
107 | 107 | m_alpha_tilemap->set_transparent_pen(0); |
108 | 108 | |
109 | 109 | /* reset the statics */ |
110 | m_yscroll_reset_timer = machine().scheduler().timer_alloc(FUNC(reset_yscroll_callback)); | |
110 | m_yscroll_reset_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(atarisy2_state::reset_yscroll_callback),this)); | |
111 | 111 | m_videobank = 0; |
112 | 112 | |
113 | 113 | /* save states */ |
r18112 | r18113 | |
150 | 150 | } |
151 | 151 | |
152 | 152 | |
153 | ||
153 | TIMER_CALLBACK_MEMBER(atarisy2_state::reset_yscroll_callback) | |
154 | 154 | { |
155 | atarisy2_state *state = machine.driver_data<atarisy2_state>(); | |
156 | state->m_playfield_tilemap->set_scrolly(0, param); | |
155 | m_playfield_tilemap->set_scrolly(0, param); | |
157 | 156 | } |
158 | 157 | |
159 | 158 |
r18112 | r18113 | |
---|---|---|
44 | 44 | |
45 | 45 | /*****************************************************************************/ |
46 | 46 | |
47 | ||
47 | TIMER_CALLBACK_MEMBER(m92_state::spritebuffer_callback) | |
48 | 48 | { |
49 | m92_state *state = machine.driver_data<m92_state>(); | |
50 | state->m_sprite_buffer_busy = 1; | |
51 | if (state->m_game_kludge!=2) /* Major Title 2 doesn't like this interrupt!? */ | |
52 | m92_sprite_interrupt(machine); | |
49 | m_sprite_buffer_busy = 1; | |
50 | if (m_game_kludge!=2) /* Major Title 2 doesn't like this interrupt!? */ | |
51 | m92_sprite_interrupt(machine()); | |
53 | 52 | } |
54 | 53 | |
55 | 54 | WRITE16_MEMBER(m92_state::m92_spritecontrol_w) |
r18112 | r18113 | |
82 | 81 | |
83 | 82 | /* Pixel clock is 26.6666MHz (some boards 27MHz??), we have 0x800 bytes, or 0x400 words to copy from |
84 | 83 | spriteram to the buffer. It seems safe to assume 1 word can be copied per clock. */ |
85 | machine().scheduler().timer_set(attotime::from_hz(XTAL_26_66666MHz) * 0x400, FUNC(spritebuffer_callback)); | |
84 | machine().scheduler().timer_set(attotime::from_hz(XTAL_26_66666MHz) * 0x400, timer_expired_delegate(FUNC(m92_state::spritebuffer_callback),this)); | |
86 | 85 | } |
87 | 86 | // logerror("%04x: m92_spritecontrol_w %08x %08x\n",space.device().safe_pc(),offset,data); |
88 | 87 | } |
r18112 | r18113 | |
---|---|---|
312 | 312 | state->m_tmpbitmap1.pix16(y, x) = (color == 0x7f) ? 0xff : color; |
313 | 313 | } |
314 | 314 | |
315 | ||
315 | TIMER_CALLBACK_MEMBER(nbmj8891_state::blitter_timer_callback) | |
316 | 316 | { |
317 | 317 | nb1413m3_busyflag = 1; |
318 | 318 | } |
r18112 | r18113 | |
462 | 462 | } |
463 | 463 | |
464 | 464 | nb1413m3_busyflag = 0; |
465 | machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback)); | |
465 | machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, timer_expired_delegate(FUNC(nbmj8891_state::blitter_timer_callback),state)); | |
466 | 466 | } |
467 | 467 | |
468 | 468 | /****************************************************************************** |
r18112 | r18113 | |
---|---|---|
419 | 419 | * |
420 | 420 | *************************************/ |
421 | 421 | |
422 | ||
422 | TIMER_CALLBACK_MEMBER(itech8_state::blitter_done) | |
423 | 423 | { |
424 | itech8_state *state = machine.driver_data<itech8_state>(); | |
425 | 424 | /* turn off blitting and generate an interrupt */ |
426 | state->m_blit_in_progress = 0; | |
427 | itech8_update_interrupts(machine, -1, -1, 1); | |
425 | m_blit_in_progress = 0; | |
426 | itech8_update_interrupts(machine(), -1, -1, 1); | |
428 | 427 | |
429 | if (FULL_LOGGING) logerror("------------ BLIT DONE (%d) --------------\n", machine.primary_screen->vpos()); | |
428 | if (FULL_LOGGING) logerror("------------ BLIT DONE (%d) --------------\n", machine().primary_screen->vpos()); | |
430 | 429 | } |
431 | 430 | |
432 | 431 | |
r18112 | r18113 | |
502 | 501 | m_blit_in_progress = 1; |
503 | 502 | |
504 | 503 | /* set a timer to go off when we're done */ |
505 | machine().scheduler().timer_set(attotime::from_hz(12000000/4) * (BLITTER_WIDTH * BLITTER_HEIGHT + 12), FUNC(blitter_done)); | |
504 | machine().scheduler().timer_set(attotime::from_hz(12000000/4) * (BLITTER_WIDTH * BLITTER_HEIGHT + 12), timer_expired_delegate(FUNC(itech8_state::blitter_done),this)); | |
506 | 505 | } |
507 | 506 | |
508 | 507 | /* debugging */ |
r18112 | r18113 | |
---|---|---|
150 | 150 | state->m_flipscreen_old = state->m_flipscreen; |
151 | 151 | } |
152 | 152 | |
153 | ||
153 | TIMER_CALLBACK_MEMBER(pastelg_state::blitter_timer_callback) | |
154 | 154 | { |
155 | 155 | nb1413m3_busyflag = 1; |
156 | 156 | } |
r18112 | r18113 | |
276 | 276 | } |
277 | 277 | |
278 | 278 | nb1413m3_busyflag = 0; |
279 | machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback)); | |
279 | machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, timer_expired_delegate(FUNC(pastelg_state::blitter_timer_callback),state)); | |
280 | 280 | } |
281 | 281 | |
282 | 282 | /****************************************************************************** |
r18112 | r18113 | |
---|---|---|
27 | 27 | * |
28 | 28 | *************************************/ |
29 | 29 | |
30 | ||
30 | TIMER_CALLBACK_MEMBER(leland_state::scanline_callback) | |
31 | 31 | { |
32 | leland_state *state = machine.driver_data<leland_state>(); | |
33 | device_t *audio = machine.device("custom"); | |
32 | device_t *audio = machine().device("custom"); | |
34 | 33 | int scanline = param; |
35 | 34 | |
36 | 35 | /* update the DACs */ |
37 | if (!(state->m_dac_control & 0x01)) | |
38 | leland_dac_update(audio, 0, state->m_video_ram[(state->m_last_scanline) * 256 + 160]); | |
36 | if (!(m_dac_control & 0x01)) | |
37 | leland_dac_update(audio, 0, m_video_ram[(m_last_scanline) * 256 + 160]); | |
39 | 38 | |
40 | if (!(state->m_dac_control & 0x02)) | |
41 | leland_dac_update(audio, 1, state->m_video_ram[(state->m_last_scanline) * 256 + 161]); | |
39 | if (!(m_dac_control & 0x02)) | |
40 | leland_dac_update(audio, 1, m_video_ram[(m_last_scanline) * 256 + 161]); | |
42 | 41 | |
43 | | |
42 | m_last_scanline = scanline; | |
44 | 43 | |
45 | 44 | scanline = (scanline+1) % 256; |
46 | 45 | |
47 | 46 | /* come back at the next appropriate scanline */ |
48 | | |
47 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
49 | 48 | } |
50 | 49 | |
51 | 50 | |
r18112 | r18113 | |
61 | 60 | m_video_ram = auto_alloc_array_clear(machine(), UINT8, VRAM_SIZE); |
62 | 61 | |
63 | 62 | /* scanline timer */ |
64 | m_scanline_timer = machine().scheduler().timer_alloc(FUNC(scanline_callback)); | |
63 | m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(leland_state::scanline_callback),this)); | |
65 | 64 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(0)); |
66 | 65 | |
67 | 66 | } |
r18112 | r18113 | |
288 | 287 | } |
289 | 288 | |
290 | 289 | |
291 | ||
290 | TIMER_CALLBACK_MEMBER(leland_state::leland_delayed_mvram_w) | |
292 | 291 | { |
293 | address_space &space = machine.device("master")->memory().space(AS_PROGRAM); | |
292 | address_space &space = machine().device("master")->memory().space(AS_PROGRAM); | |
294 | 293 | |
295 | 294 | int num = (param >> 16) & 1; |
296 | 295 | int offset = (param >> 8) & 0xff; |
r18112 | r18113 | |
301 | 300 | |
302 | 301 | WRITE8_MEMBER(leland_state::leland_mvram_port_w) |
303 | 302 | { |
304 | machine().scheduler().synchronize(FUNC(leland_delayed_mvram_w), 0x00000 | (offset << 8) | data); | |
303 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(leland_state::leland_delayed_mvram_w),this), 0x00000 | (offset << 8) | data); | |
305 | 304 | } |
306 | 305 | |
307 | 306 | |
r18112 | r18113 | |
346 | 345 | WRITE8_MEMBER(leland_state::ataxx_mvram_port_w) |
347 | 346 | { |
348 | 347 | offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10); |
349 | machine().scheduler().synchronize(FUNC(leland_delayed_mvram_w), 0x00000 | (offset << 8) | data); | |
348 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(leland_state::leland_delayed_mvram_w),this), 0x00000 | (offset << 8) | data); | |
350 | 349 | } |
351 | 350 | |
352 | 351 |
r18112 | r18113 | |
---|---|---|
891 | 891 | state->m_counter++; |
892 | 892 | } |
893 | 893 | |
894 | ||
894 | TIMER_CALLBACK_MEMBER(dkong_state::scanline_callback) | |
895 | 895 | { |
896 | dkong_state *state = machine.driver_data<dkong_state>(); | |
897 | 896 | int scanline = param; |
898 | 897 | |
899 | if ((state->m_hardware_type == HARDWARE_TRS02) || (state->m_hardware_type == HARDWARE_TRS01)) | |
900 | radarscp_scanline(machine, scanline); | |
898 | if ((m_hardware_type == HARDWARE_TRS02) || (m_hardware_type == HARDWARE_TRS01)) | |
899 | radarscp_scanline(machine(), scanline); | |
901 | 900 | |
902 | 901 | /* update any video up to the current scanline */ |
903 | machine.primary_screen->update_now(); | |
902 | machine().primary_screen->update_now(); | |
904 | 903 | |
905 | 904 | scanline = (scanline+1) % VTOTAL; |
906 | 905 | /* come back at the next appropriate scanline */ |
907 | | |
906 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
908 | 907 | } |
909 | 908 | |
910 | 909 | static void check_palette(running_machine &machine) |
r18112 | r18113 | |
958 | 957 | |
959 | 958 | VIDEO_START_CALL_MEMBER(dkong_base); |
960 | 959 | |
961 | m_scanline_timer = machine().scheduler().timer_alloc(FUNC(scanline_callback)); | |
960 | m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dkong_state::scanline_callback),this)); | |
962 | 961 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(0)); |
963 | 962 | |
964 | 963 | switch (m_hardware_type) |
r18112 | r18113 | |
---|---|---|
148 | 148 | } |
149 | 149 | |
150 | 150 | |
151 | ||
151 | TIMER_CALLBACK_MEMBER(sprint8_state::sprint8_collision_callback) | |
152 | 152 | { |
153 | sprint8_set_collision(machine, param); | |
153 | sprint8_set_collision(machine(), param); | |
154 | 154 | } |
155 | 155 | |
156 | 156 | |
r18112 | r18113 | |
186 | 186 | for (x = visarea.min_x; x <= visarea.max_x; x++) |
187 | 187 | if (p1[x] != 0x20 && p2[x] == 0x23) |
188 | 188 | machine().scheduler().timer_set(machine().primary_screen->time_until_pos(y + 24, x), |
189 | FUNC(sprint8_collision_callback), | |
189 | timer_expired_delegate(FUNC(sprint8_state::sprint8_collision_callback),this), | |
190 | 190 | colortable_entry_get_value(machine().colortable, p1[x])); |
191 | 191 | } |
192 | 192 | } |
r18112 | r18113 | |
---|---|---|
31 | 31 | *************************************/ |
32 | 32 | |
33 | 33 | static void init_savestate(running_machine &machine); |
34 | static TIMER_CALLBACK( scanline_callback ); | |
35 | static TIMER_CALLBACK( interrupt_off ); | |
34 | ||
35 | ||
36 | 36 | static void init_sparklestar(running_machine &machine); |
37 | 37 | |
38 | 38 | |
r18112 | r18113 | |
164 | 164 | { |
165 | 165 | |
166 | 166 | /* allocate timers */ |
167 | m_scanline_timer = machine().scheduler().timer_alloc(FUNC(scanline_callback)); | |
167 | m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(astrocde_state::scanline_callback),this)); | |
168 | 168 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(1), 1); |
169 | m_intoff_timer = machine().scheduler().timer_alloc(FUNC(interrupt_off)); | |
169 | m_intoff_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(astrocde_state::interrupt_off),this)); | |
170 | 170 | |
171 | 171 | /* register for save states */ |
172 | 172 | init_savestate(machine()); |
r18112 | r18113 | |
181 | 181 | { |
182 | 182 | |
183 | 183 | /* allocate timers */ |
184 | m_scanline_timer = machine().scheduler().timer_alloc(FUNC(scanline_callback)); | |
184 | m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(astrocde_state::scanline_callback),this)); | |
185 | 185 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(1), 1); |
186 | m_intoff_timer = machine().scheduler().timer_alloc(FUNC(interrupt_off)); | |
186 | m_intoff_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(astrocde_state::interrupt_off),this)); | |
187 | 187 | |
188 | 188 | /* allocate videoram */ |
189 | 189 | m_profpac_videoram = auto_alloc_array(machine(), UINT16, 0x4000 * 4); |
r18112 | r18113 | |
373 | 373 | * |
374 | 374 | *************************************/ |
375 | 375 | |
376 | ||
376 | TIMER_CALLBACK_MEMBER(astrocde_state::interrupt_off) | |
377 | 377 | { |
378 | machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE); | |
378 | machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE); | |
379 | 379 | } |
380 | 380 | |
381 | 381 | |
r18112 | r18113 | |
414 | 414 | * |
415 | 415 | *************************************/ |
416 | 416 | |
417 | ||
417 | TIMER_CALLBACK_MEMBER(astrocde_state::scanline_callback) | |
418 | 418 | { |
419 | astrocde_state *state = machine.driver_data<astrocde_state>(); | |
420 | 419 | int scanline = param; |
421 | 420 | int astrocade_scanline = mame_vpos_to_astrocade_vpos(scanline); |
422 | 421 | |
423 | 422 | /* force an update against the current scanline */ |
424 | 423 | if (scanline > 0) |
425 | machine.primary_screen->update_partial(scanline - 1); | |
424 | machine().primary_screen->update_partial(scanline - 1); | |
426 | 425 | |
427 | 426 | /* generate a scanline interrupt if it's time */ |
428 | if (astrocade_scanline == | |
427 | if (astrocade_scanline == m_interrupt_scanline && (m_interrupt_enabl & 0x08) != 0) | |
429 | 428 | { |
430 | 429 | /* bit 2 controls the interrupt mode: mode 0 means assert until acknowledged */ |
431 | if (( | |
430 | if ((m_interrupt_enabl & 0x04) == 0) | |
432 | 431 | { |
433 | machine.device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, state->m_interrupt_vector); | |
434 | machine.scheduler().timer_set(machine.primary_screen->time_until_vblank_end(), FUNC(interrupt_off)); | |
432 | machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, m_interrupt_vector); | |
433 | machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_end(), timer_expired_delegate(FUNC(astrocde_state::interrupt_off),this)); | |
435 | 434 | } |
436 | 435 | |
437 | 436 | /* mode 1 means assert for 1 instruction */ |
438 | 437 | else |
439 | 438 | { |
440 | machine.device("maincpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, state->m_interrupt_vector); | |
441 | machine.scheduler().timer_set(machine.device<cpu_device>("maincpu")->cycles_to_attotime(1), FUNC(interrupt_off)); | |
439 | machine().device("maincpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, m_interrupt_vector); | |
440 | machine().scheduler().timer_set(machine().device<cpu_device>("maincpu")->cycles_to_attotime(1), timer_expired_delegate(FUNC(astrocde_state::interrupt_off),this)); | |
442 | 441 | } |
443 | 442 | } |
444 | 443 | |
445 | 444 | /* on some games, the horizontal drive line is conected to the lightpen interrupt */ |
446 | else if (state->m_video_config & AC_LIGHTPEN_INTS) | |
447 | astrocade_trigger_lightpen(machine, astrocade_scanline, 8); | |
445 | else if (m_video_config & AC_LIGHTPEN_INTS) | |
446 | astrocade_trigger_lightpen(machine(), astrocade_scanline, 8); | |
448 | 447 | |
449 | 448 | /* advance to the next scanline */ |
450 | 449 | scanline++; |
451 | if (scanline >= machine.primary_screen->height()) | |
450 | if (scanline >= machine().primary_screen->height()) | |
452 | 451 | scanline = 0; |
453 | | |
452 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
454 | 453 | } |
455 | 454 | |
456 | 455 |
r18112 | r18113 | |
---|---|---|
266 | 266 | update_pixel(state, x, y); |
267 | 267 | } |
268 | 268 | |
269 | ||
269 | TIMER_CALLBACK_MEMBER(nbmj8688_state::blitter_timer_callback) | |
270 | 270 | { |
271 | 271 | nb1413m3_busyflag = 1; |
272 | 272 | } |
r18112 | r18113 | |
525 | 525 | nb1413m3_busyflag = 0; |
526 | 526 | |
527 | 527 | if (gfxtype == GFXTYPE_8BIT) |
528 | machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback)); | |
528 | machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, timer_expired_delegate(FUNC(nbmj8688_state::blitter_timer_callback),state)); | |
529 | 529 | else |
530 | machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback)); | |
530 | machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, timer_expired_delegate(FUNC(nbmj8688_state::blitter_timer_callback),state)); | |
531 | 531 | } |
532 | 532 | |
533 | 533 |
r18112 | r18113 | |
---|---|---|
168 | 168 | } |
169 | 169 | |
170 | 170 | |
171 | ||
171 | TIMER_CALLBACK_MEMBER(tank8_state::tank8_collision_callback) | |
172 | 172 | { |
173 | tank8_set_collision(machine, param); | |
173 | tank8_set_collision(machine(), param); | |
174 | 174 | } |
175 | 175 | |
176 | 176 | |
r18112 | r18113 | |
269 | 269 | index |= 0x80; /* collision on right side */ |
270 | 270 | } |
271 | 271 | |
272 | machine().scheduler().timer_set(screen.time_until_pos(y, x), FUNC(tank8_collision_callback), index); | |
272 | machine().scheduler().timer_set(screen.time_until_pos(y, x), timer_expired_delegate(FUNC(tank8_state::tank8_collision_callback),this), index); | |
273 | 273 | |
274 | 274 | _state = 1; |
275 | 275 | } |
r18112 | r18113 | |
---|---|---|
19 | 19 | |
20 | 20 | |
21 | 21 | |
22 | ||
22 | TIMER_CALLBACK_MEMBER(cchasm_state::cchasm_refresh_end) | |
23 | 23 | { |
24 | machine.device("maincpu")->execute().set_input_line(2, ASSERT_LINE); | |
24 | machine().device("maincpu")->execute().set_input_line(2, ASSERT_LINE); | |
25 | 25 | } |
26 | 26 | |
27 | 27 | static void cchasm_refresh (running_machine &machine) |
r18112 | r18113 | |
99 | 99 | } |
100 | 100 | } |
101 | 101 | /* Refresh processor runs with 6 MHz */ |
102 | machine.scheduler().timer_set (attotime::from_hz(6000000) * total_length, FUNC(cchasm_refresh_end)); | |
102 | machine.scheduler().timer_set (attotime::from_hz(6000000) * total_length, timer_expired_delegate(FUNC(cchasm_state::cchasm_refresh_end),state)); | |
103 | 103 | } |
104 | 104 | |
105 | 105 |
r18112 | r18113 | |
---|---|---|
15 | 15 | m_frame_vbl = 0; |
16 | 16 | } |
17 | 17 | |
18 | ||
18 | TIMER_CALLBACK_MEMBER(esripsys_state::hblank_start_callback) | |
19 | 19 | { |
20 | esripsys_state *state = machine.driver_data<esripsys_state>(); | |
21 | int v = machine.primary_screen->vpos(); | |
20 | int v = machine().primary_screen->vpos(); | |
22 | 21 | |
23 | if ( | |
22 | if (m_video_firq) | |
24 | 23 | { |
25 | state->m_video_firq = 0; | |
26 | machine.device("game_cpu")->execute().set_input_line(M6809_FIRQ_LINE, CLEAR_LINE); | |
24 | m_video_firq = 0; | |
25 | machine().device("game_cpu")->execute().set_input_line(M6809_FIRQ_LINE, CLEAR_LINE); | |
27 | 26 | } |
28 | 27 | |
29 | 28 | /* Not sure if this is totally accurate - I couldn't find the circuit that generates the FIRQs! */ |
30 | if (!(v % 6) && v && | |
29 | if (!(v % 6) && v && m_video_firq_en && v < ESRIPSYS_VBLANK_START) | |
31 | 30 | { |
32 | state->m_video_firq = 1; | |
33 | machine.device("game_cpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); | |
31 | m_video_firq = 1; | |
32 | machine().device("game_cpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE); | |
34 | 33 | } |
35 | 34 | |
36 | 35 | /* Adjust for next scanline */ |
r18112 | r18113 | |
38 | 37 | v = 0; |
39 | 38 | |
40 | 39 | /* Set end of HBLANK timer */ |
41 | state->m_hblank_end_timer->adjust(machine.primary_screen->time_until_pos(v, ESRIPSYS_HBLANK_END), v); | |
42 | state->m_hblank = 0; | |
40 | m_hblank_end_timer->adjust(machine().primary_screen->time_until_pos(v, ESRIPSYS_HBLANK_END), v); | |
41 | m_hblank = 0; | |
43 | 42 | } |
44 | 43 | |
45 | ||
44 | TIMER_CALLBACK_MEMBER(esripsys_state::hblank_end_callback) | |
46 | 45 | { |
47 | esripsys_state *state = machine.driver_data<esripsys_state>(); | |
48 | int v = machine.primary_screen->vpos(); | |
46 | int v = machine().primary_screen->vpos(); | |
49 | 47 | |
50 | 48 | if (v > 0) |
51 | machine.primary_screen->update_partial(v - 1); | |
49 | machine().primary_screen->update_partial(v - 1); | |
52 | 50 | |
53 | state->m_12sel ^= 1; | |
54 | state->m_hblank_start_timer->adjust(machine.primary_screen->time_until_pos(v, ESRIPSYS_HBLANK_START)); | |
51 | m_12sel ^= 1; | |
52 | m_hblank_start_timer->adjust(machine().primary_screen->time_until_pos(v, ESRIPSYS_HBLANK_START)); | |
55 | 53 | |
56 | | |
54 | m_hblank = 1; | |
57 | 55 | } |
58 | 56 | |
59 | 57 | void esripsys_state::video_start() |
r18112 | r18113 | |
71 | 69 | line_buffer[1].priority_buf = auto_alloc_array(machine(), UINT8, 512); |
72 | 70 | |
73 | 71 | /* Create and initialise the HBLANK timers */ |
74 | m_hblank_start_timer = machine().scheduler().timer_alloc(FUNC(hblank_start_callback)); | |
75 | m_hblank_end_timer = machine().scheduler().timer_alloc(FUNC(hblank_end_callback)); | |
72 | m_hblank_start_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(esripsys_state::hblank_start_callback),this)); | |
73 | m_hblank_end_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(esripsys_state::hblank_end_callback),this)); | |
76 | 74 | m_hblank_start_timer->adjust(machine().primary_screen->time_until_pos(0, ESRIPSYS_HBLANK_START)); |
77 | 75 | |
78 | 76 | /* Create the sprite scaling table */ |
r18112 | r18113 | |
---|---|---|
172 | 172 | state->m_tmpbitmap.pix16(y, x) = color; |
173 | 173 | } |
174 | 174 | |
175 | ||
175 | TIMER_CALLBACK_MEMBER(nbmj8991_state::blitter_timer_callback) | |
176 | 176 | { |
177 | 177 | nb1413m3_busyflag = 1; |
178 | 178 | } |
r18112 | r18113 | |
280 | 280 | } |
281 | 281 | |
282 | 282 | nb1413m3_busyflag = 0; |
283 | machine.scheduler().timer_set(attotime::from_nsec(1650) * nb1413m3_busyctr, FUNC(blitter_timer_callback)); | |
283 | machine.scheduler().timer_set(attotime::from_nsec(1650) * nb1413m3_busyctr, timer_expired_delegate(FUNC(nbmj8991_state::blitter_timer_callback),state)); | |
284 | 284 | } |
285 | 285 | |
286 | 286 | /****************************************************************************** |
r18112 | r18113 | |
---|---|---|
248 | 248 | * |
249 | 249 | *************************************/ |
250 | 250 | |
251 | ||
251 | TIMER_CALLBACK_MEMBER(exidy440_state::beam_firq_callback) | |
252 | 252 | { |
253 | exidy440_state *state = machine.driver_data<exidy440_state>(); | |
254 | 253 | /* generate the interrupt, if we're selected */ |
255 | if ( | |
254 | if (m_firq_select && m_firq_enable) | |
256 | 255 | { |
257 | state->m_firq_beam = 1; | |
258 | exidy440_update_firq(machine); | |
256 | m_firq_beam = 1; | |
257 | exidy440_update_firq(machine()); | |
259 | 258 | } |
260 | 259 | |
261 | 260 | /* round the x value to the nearest byte */ |
262 | 261 | param = (param + 1) / 2; |
263 | 262 | |
264 | 263 | /* latch the x value; this convolution comes from the read routine */ |
265 | | |
264 | m_latched_x = (param + 3) ^ 2; | |
266 | 265 | } |
267 | 266 | |
268 | 267 | |
269 | ||
268 | TIMER_CALLBACK_MEMBER(exidy440_state::collide_firq_callback) | |
270 | 269 | { |
271 | exidy440_state *state = machine.driver_data<exidy440_state>(); | |
272 | 270 | /* generate the interrupt, if we're selected */ |
273 | if (! | |
271 | if (!m_firq_select && m_firq_enable) | |
274 | 272 | { |
275 | state->m_firq_beam = 1; | |
276 | exidy440_update_firq(machine); | |
273 | m_firq_beam = 1; | |
274 | exidy440_update_firq(machine()); | |
277 | 275 | } |
278 | 276 | |
279 | 277 | /* round the x value to the nearest byte */ |
280 | 278 | param = (param + 1) / 2; |
281 | 279 | |
282 | 280 | /* latch the x value; this convolution comes from the read routine */ |
283 | | |
281 | m_latched_x = (param + 3) ^ 2; | |
284 | 282 | } |
285 | 283 | |
286 | 284 | |
r18112 | r18113 | |
360 | 358 | |
361 | 359 | /* check the collisions bit */ |
362 | 360 | if (check_collision && (palette[2 * pen] & 0x80) && (count++ < 128)) |
363 | screen.machine().scheduler().timer_set(screen.time_until_pos(yoffs, currx), FUNC(collide_firq_callback), currx); | |
361 | screen.machine().scheduler().timer_set(screen.time_until_pos(yoffs, currx), timer_expired_delegate(FUNC(exidy440_state::collide_firq_callback),state), currx); | |
364 | 362 | } |
365 | 363 | currx++; |
366 | 364 | |
r18112 | r18113 | |
373 | 371 | |
374 | 372 | /* check the collisions bit */ |
375 | 373 | if (check_collision && (palette[2 * pen] & 0x80) && (count++ < 128)) |
376 | screen.machine().scheduler().timer_set(screen.time_until_pos(yoffs, currx), FUNC(collide_firq_callback), currx); | |
374 | screen.machine().scheduler().timer_set(screen.time_until_pos(yoffs, currx), timer_expired_delegate(FUNC(exidy440_state::collide_firq_callback),state), currx); | |
377 | 375 | } |
378 | 376 | currx++; |
379 | 377 | } |
r18112 | r18113 | |
445 | 443 | attotime time = screen.time_until_pos(beamy, beamx) - increment * 6; |
446 | 444 | for (i = 0; i <= 12; i++) |
447 | 445 | { |
448 | machine().scheduler().timer_set(time, FUNC(beam_firq_callback), beamx); | |
446 | machine().scheduler().timer_set(time, timer_expired_delegate(FUNC(exidy440_state::beam_firq_callback),this), beamx); | |
449 | 447 | time += increment; |
450 | 448 | } |
451 | 449 | } |
r18112 | r18113 | |
---|---|---|
87 | 87 | * |
88 | 88 | *************************************/ |
89 | 89 | |
90 | ||
90 | TIMER_CALLBACK_MEMBER(blstroid_state::irq_off) | |
91 | 91 | { |
92 | address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM); | |
92 | address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM); | |
93 | 93 | |
94 | 94 | /* clear the interrupt */ |
95 | 95 | atarigen_scanline_int_ack_w(space, 0, 0, 0xffff); |
96 | 96 | } |
97 | 97 | |
98 | 98 | |
99 | ||
99 | TIMER_CALLBACK_MEMBER(blstroid_state::irq_on) | |
100 | 100 | { |
101 | 101 | /* generate the interrupt */ |
102 | atarigen_scanline_int_gen(machine.device("maincpu")); | |
103 | atarigen_update_interrupts(machine); | |
102 | atarigen_scanline_int_gen(machine().device("maincpu")); | |
103 | atarigen_update_interrupts(machine()); | |
104 | 104 | } |
105 | 105 | |
106 | 106 | |
r18112 | r18113 | |
129 | 129 | period_on = screen.time_until_pos(vpos + 7, width * 0.9); |
130 | 130 | period_off = screen.time_until_pos(vpos + 8, width * 0.9); |
131 | 131 | |
132 | screen.machine().scheduler().timer_set(period_on, FUNC(irq_on)); | |
133 | screen.machine().scheduler().timer_set(period_off, FUNC(irq_off)); | |
132 | screen.machine().scheduler().timer_set(period_on, timer_expired_delegate(FUNC(blstroid_state::irq_on),state)); | |
133 | screen.machine().scheduler().timer_set(period_off, timer_expired_delegate(FUNC(blstroid_state::irq_off),state)); | |
134 | 134 | } |
135 | 135 | } |
136 | 136 |
r18112 | r18113 | |
---|---|---|
203 | 203 | state->m_tmpbitmap1.pix16(y, x) = machine.pens[color]; |
204 | 204 | } |
205 | 205 | |
206 | ||
206 | TIMER_CALLBACK_MEMBER(nbmj8900_state::blitter_timer_callback) | |
207 | 207 | { |
208 | 208 | nb1413m3_busyflag = 1; |
209 | 209 | } |
r18112 | r18113 | |
357 | 357 | } |
358 | 358 | |
359 | 359 | nb1413m3_busyflag = 0; |
360 | machine.scheduler().timer_set(attotime::from_nsec(2500) * nb1413m3_busyctr, FUNC(blitter_timer_callback)); | |
360 | machine.scheduler().timer_set(attotime::from_nsec(2500) * nb1413m3_busyctr, timer_expired_delegate(FUNC(nbmj8900_state::blitter_timer_callback),state)); | |
361 | 361 | } |
362 | 362 | |
363 | 363 | /****************************************************************************** |
r18112 | r18113 | |
---|---|---|
1068 | 1068 | } |
1069 | 1069 | |
1070 | 1070 | |
1071 | ||
1071 | TIMER_CALLBACK_MEMBER(victory_state::bgcoll_irq_callback) | |
1072 | 1072 | { |
1073 | victory_state *state = machine.driver_data<victory_state>(); | |
1074 | state->m_bgcollx = param & 0xff; | |
1075 | state->m_bgcolly = param >> 8; | |
1076 | state->m_bgcoll = 1; | |
1077 | victory_update_irq(machine); | |
1073 | m_bgcollx = param & 0xff; | |
1074 | m_bgcolly = param >> 8; | |
1075 | m_bgcoll = 1; | |
1076 | victory_update_irq(machine()); | |
1078 | 1077 | } |
1079 | 1078 | |
1080 | 1079 | |
r18112 | r18113 | |
1113 | 1112 | int bpix = bg[(x + m_scrollx) & 255]; |
1114 | 1113 | scanline[x] = bpix | (fpix << 3); |
1115 | 1114 | if (fpix && (bpix & bgcollmask) && count++ < 128) |
1116 | machine().scheduler().timer_set(screen.time_until_pos(y, x), FUNC(bgcoll_irq_callback), x | (y << 8)); | |
1115 | machine().scheduler().timer_set(screen.time_until_pos(y, x), timer_expired_delegate(FUNC(victory_state::bgcoll_irq_callback),this), x | (y << 8)); | |
1117 | 1116 | } |
1118 | 1117 | } |
1119 | 1118 |
r18112 | r18113 | |
---|---|---|
11 | 11 | #include "includes/fromance.h" |
12 | 12 | |
13 | 13 | |
14 | static TIMER_CALLBACK( crtc_interrupt_gen ); | |
15 | 14 | |
15 | ||
16 | 16 | /************************************* |
17 | 17 | * |
18 | 18 | * Tilemap callbacks |
r18112 | r18113 | |
70 | 70 | state->m_fg_tilemap->set_transparent_pen(15); |
71 | 71 | |
72 | 72 | /* reset the timer */ |
73 | state->m_crtc_timer = machine.scheduler().timer_alloc(FUNC(crtc_interrupt_gen)); | |
73 | state->m_crtc_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(fromance_state::crtc_interrupt_gen),state)); | |
74 | 74 | |
75 | 75 | /* state save */ |
76 | 76 | state->save_item(NAME(state->m_selected_videoram)); |
r18112 | r18113 | |
251 | 251 | * |
252 | 252 | *************************************/ |
253 | 253 | |
254 | ||
254 | TIMER_CALLBACK_MEMBER(fromance_state::crtc_interrupt_gen) | |
255 | 255 | { |
256 | fromance_state *state = machine.driver_data<fromance_state>(); | |
257 | state->m_subcpu->set_input_line(0, HOLD_LINE); | |
256 | m_subcpu->set_input_line(0, HOLD_LINE); | |
258 | 257 | if (param != 0) |
259 | | |
258 | m_crtc_timer->adjust(machine().primary_screen->frame_period() / param, 0, machine().primary_screen->frame_period() / param); | |
260 | 259 | } |
261 | 260 | |
262 | 261 |
r18112 | r18113 | |
---|---|---|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
57 | ||
57 | TIMER_CALLBACK_MEMBER(n8080_state::spacefev_stop_red_cannon) | |
58 | 58 | { |
59 | n8080_state *state = machine.driver_data<n8080_state>(); | |
60 | 59 | |
61 | state->m_spacefev_red_cannon = 0; | |
62 | state->m_cannon_timer->adjust(attotime::never); | |
60 | m_spacefev_red_cannon = 0; | |
61 | m_cannon_timer->adjust(attotime::never); | |
63 | 62 | } |
64 | 63 | |
65 | 64 | |
r18112 | r18113 | |
91 | 90 | VIDEO_START_MEMBER(n8080_state,spacefev) |
92 | 91 | { |
93 | 92 | |
94 | m_cannon_timer = machine().scheduler().timer_alloc(FUNC(spacefev_stop_red_cannon)); | |
93 | m_cannon_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(n8080_state::spacefev_stop_red_cannon),this)); | |
95 | 94 | |
96 | 95 | flip_screen_set_no_update(0); |
97 | 96 |
r18112 | r18113 | |
---|---|---|
298 | 298 | * |
299 | 299 | *************************************/ |
300 | 300 | |
301 | ||
301 | TIMER_CALLBACK_MEMBER(segas32_state::update_sprites) | |
302 | 302 | { |
303 | segas32_state *state = machine.driver_data<segas32_state>(); | |
304 | 303 | /* if automatic mode is selected, do it every frame (0) or every other frame (1) */ |
305 | if (!( | |
304 | if (!(m_sprite_control[3] & 2)) | |
306 | 305 | { |
307 | 306 | /* if we count down to the start, process the automatic swapping, but only after a short delay */ |
308 | if ( | |
307 | if (m_sprite_render_count-- == 0) | |
309 | 308 | { |
310 | state->m_sprite_control[0] = 3; | |
311 | state->m_sprite_render_count = state->m_sprite_control[3] & 1; | |
309 | m_sprite_control[0] = 3; | |
310 | m_sprite_render_count = m_sprite_control[3] & 1; | |
312 | 311 | } |
313 | 312 | } |
314 | 313 | |
315 | 314 | /* look for pending commands */ |
316 | if (state->m_sprite_control[0] & 2) | |
317 | sprite_erase_buffer(state); | |
318 | if (state->m_sprite_control[0] & 1) | |
315 | if (m_sprite_control[0] & 2) | |
316 | sprite_erase_buffer(this); | |
317 | if (m_sprite_control[0] & 1) | |
319 | 318 | { |
320 | sprite_swap_buffers(state); | |
321 | sprite_render_list(machine); | |
319 | sprite_swap_buffers(this); | |
320 | sprite_render_list(machine()); | |
322 | 321 | } |
323 | | |
322 | m_sprite_control[0] = 0; | |
324 | 323 | } |
325 | 324 | |
326 | 325 | |
327 | 326 | void system32_set_vblank(running_machine &machine, int state) |
328 | 327 | { |
328 | segas32_state *drvstate = machine.driver_data<segas32_state>(); | |
329 | 329 | /* at the end of VBLANK is when automatic sprite rendering happens */ |
330 | 330 | if (!state) |
331 | machine.scheduler().timer_set(attotime::from_usec(50), FUNC(update_sprites), 1); | |
331 | machine.scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(segas32_state::update_sprites),drvstate), 1); | |
332 | 332 | } |
333 | 333 | |
334 | 334 |
r18112 | r18113 | |
---|---|---|
71 | 71 | |
72 | 72 | *********************************************************************/ |
73 | 73 | |
74 | ||
74 | TIMER_CALLBACK_MEMBER(vectrex_state::lightpen_trigger) | |
75 | 75 | { |
76 | vectrex_state *state = machine.driver_data<vectrex_state>(); | |
77 | if (state->m_lightpen_port & 1) | |
76 | if (m_lightpen_port & 1) | |
78 | 77 | { |
79 | via6522_device *via_0 = machine.device<via6522_device>("via6522_0"); | |
78 | via6522_device *via_0 = machine().device<via6522_device>("via6522_0"); | |
80 | 79 | via_0->write_ca1(1); |
81 | 80 | via_0->write_ca1(0); |
82 | 81 | } |
83 | 82 | |
84 | if ( | |
83 | if (m_lightpen_port & 2) | |
85 | 84 | { |
86 | machine.device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, PULSE_LINE); | |
85 | machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, PULSE_LINE); | |
87 | 86 | } |
88 | 87 | } |
89 | 88 | |
r18112 | r18113 | |
148 | 147 | |
149 | 148 | *********************************************************************/ |
150 | 149 | |
151 | ||
150 | TIMER_CALLBACK_MEMBER(vectrex_state::vectrex_refresh) | |
152 | 151 | { |
153 | vectrex_state *state = machine.driver_data<vectrex_state>(); | |
154 | 152 | /* Refresh only marks the range of vectors which will be drawn |
155 | 153 | * during the next SCREEN_UPDATE_RGB32. */ |
156 | state->m_display_start = state->m_display_end; | |
157 | state->m_display_end = state->m_point_index; | |
154 | m_display_start = m_display_end; | |
155 | m_display_end = m_point_index; | |
158 | 156 | } |
159 | 157 | |
160 | 158 | |
r18112 | r18113 | |
223 | 221 | } |
224 | 222 | |
225 | 223 | |
226 | ||
224 | TIMER_CALLBACK_MEMBER(vectrex_state::vectrex_zero_integrators) | |
227 | 225 | { |
228 | vectrex_state *state = machine.driver_data<vectrex_state>(); | |
229 | state->m_x_int = state->m_x_center + (state->m_analog[A_ZR] * INT_PER_CLOCK); | |
230 | state->m_y_int = state->m_y_center + (state->m_analog[A_ZR] * INT_PER_CLOCK); | |
231 | (*state->vector_add_point_function)(machine, state->m_x_int, state->m_y_int, state->m_beam_color, 0); | |
226 | m_x_int = m_x_center + (m_analog[A_ZR] * INT_PER_CLOCK); | |
227 | m_y_int = m_y_center + (m_analog[A_ZR] * INT_PER_CLOCK); | |
228 | (*vector_add_point_function)(machine(), m_x_int, m_y_int, m_beam_color, 0); | |
232 | 229 | } |
233 | 230 | |
234 | 231 | |
r18112 | r18113 | |
242 | 239 | |
243 | 240 | *********************************************************************/ |
244 | 241 | |
245 | ||
242 | TIMER_CALLBACK_MEMBER(vectrex_state::update_signal) | |
246 | 243 | { |
247 | vectrex_state *state = machine.driver_data<vectrex_state>(); | |
248 | 244 | int length; |
249 | 245 | |
250 | if (! | |
246 | if (!m_ramp) | |
251 | 247 | { |
252 | length = machine.device("maincpu")->unscaled_clock() * INT_PER_CLOCK | |
253 | * (machine.time() - state->m_vector_start_time).as_double(); | |
248 | length = machine().device("maincpu")->unscaled_clock() * INT_PER_CLOCK | |
249 | * (machine().time() - m_vector_start_time).as_double(); | |
254 | 250 | |
255 | state->m_x_int += length * (state->m_analog[A_X] + state->m_analog[A_ZR]); | |
256 | state->m_y_int += length * (state->m_analog[A_Y] + state->m_analog[A_ZR]); | |
251 | m_x_int += length * (m_analog[A_X] + m_analog[A_ZR]); | |
252 | m_y_int += length * (m_analog[A_Y] + m_analog[A_ZR]); | |
257 | 253 | |
258 | (* | |
254 | (*vector_add_point_function)(machine(), m_x_int, m_y_int, m_beam_color, 2 * m_analog[A_Z] * m_blank); | |
259 | 255 | } |
260 | 256 | else |
261 | 257 | { |
262 | if (state->m_blank) | |
263 | (*state->vector_add_point_function)(machine, state->m_x_int, state->m_y_int, state->m_beam_color, 2 * state->m_analog[A_Z]); | |
258 | if (m_blank) | |
259 | (*vector_add_point_function)(machine(), m_x_int, m_y_int, m_beam_color, 2 * m_analog[A_Z]); | |
264 | 260 | } |
265 | 261 | |
266 | | |
262 | m_vector_start_time = machine().time(); | |
267 | 263 | |
268 | 264 | if (ptr) |
269 | 265 | * (UINT8 *) ptr = param; |
r18112 | r18113 | |
289 | 285 | m_imager_freq = 1; |
290 | 286 | |
291 | 287 | vector_add_point_function = vectrex_add_point; |
292 | m_imager_timer = machine().scheduler().timer_alloc(FUNC(vectrex_imager_eye)); | |
288 | m_imager_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vectrex_state::vectrex_imager_eye),this)); | |
293 | 289 | m_imager_timer->adjust( |
294 | 290 | attotime::from_hz(m_imager_freq), |
295 | 291 | 2, |
296 | 292 | attotime::from_hz(m_imager_freq)); |
297 | 293 | |
298 | m_lp_t = machine().scheduler().timer_alloc(FUNC(lightpen_trigger)); | |
294 | m_lp_t = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vectrex_state::lightpen_trigger),this)); | |
299 | 295 | |
300 | m_refresh = machine().scheduler().timer_alloc(FUNC(vectrex_refresh)); | |
296 | m_refresh = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vectrex_state::vectrex_refresh),this)); | |
301 | 297 | |
302 | 298 | VIDEO_START_CALL_LEGACY(vector); |
303 | 299 | } |
r18112 | r18113 | |
314 | 310 | vectrex_state *state = machine.driver_data<vectrex_state>(); |
315 | 311 | dac_device *dac = machine.device<dac_device>("dac"); |
316 | 312 | |
317 | machine.scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), FUNC(update_signal), state->m_via_out[PORTA], &state->m_analog[mux]); | |
313 | machine.scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),state), state->m_via_out[PORTA], &state->m_analog[mux]); | |
318 | 314 | |
319 | 315 | if (mux == A_AUDIO) |
320 | 316 | dac->write_unsigned8(state->m_via_out[PORTA]); |
r18112 | r18113 | |
370 | 366 | if (!(data & 0x1) && (state->m_via_out[PORTB] & 0x1)) |
371 | 367 | { |
372 | 368 | /* MUX has been enabled */ |
373 | space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), FUNC(update_signal)); | |
369 | space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),state)); | |
374 | 370 | } |
375 | 371 | } |
376 | 372 | else |
r18112 | r18113 | |
407 | 403 | vectrex_multiplexer (space.machine(), (data >> 1) & 0x3); |
408 | 404 | |
409 | 405 | state->m_via_out[PORTB] = data; |
410 | space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), FUNC(update_signal), data & 0x80, &state->m_ramp); | |
406 | space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),state), data & 0x80, &state->m_ramp); | |
411 | 407 | } |
412 | 408 | |
413 | 409 | |
r18112 | r18113 | |
416 | 412 | vectrex_state *state = space.machine().driver_data<vectrex_state>(); |
417 | 413 | /* DAC output always goes to Y integrator */ |
418 | 414 | state->m_via_out[PORTA] = data; |
419 | space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), FUNC(update_signal), data, &state->m_analog[A_Y]); | |
415 | space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),state), data, &state->m_analog[A_Y]); | |
420 | 416 | |
421 | 417 | if (!(state->m_via_out[PORTB] & 0x1)) |
422 | 418 | vectrex_multiplexer (space.machine(), (state->m_via_out[PORTB] >> 1) & 0x3); |
r18112 | r18113 | |
425 | 421 | |
426 | 422 | static WRITE8_DEVICE_HANDLER(v_via_ca2_w) |
427 | 423 | { |
424 | vectrex_state *state = space.machine().driver_data<vectrex_state>(); | |
428 | 425 | if (data == 0) |
429 | space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), FUNC(vectrex_zero_integrators)); | |
426 | space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::vectrex_zero_integrators),state)); | |
430 | 427 | } |
431 | 428 | |
432 | 429 | |
r18112 | r18113 | |
451 | 448 | dx = abs(state->m_pen_x - state->m_x_int); |
452 | 449 | dy = abs(state->m_pen_y - state->m_y_int); |
453 | 450 | if (dx < 500000 && dy < 500000 && data > 0) |
454 | space.machine().scheduler().timer_set(attotime::zero, FUNC(lightpen_trigger)); | |
451 | space.machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(vectrex_state::lightpen_trigger),state)); | |
455 | 452 | } |
456 | 453 | } |
457 | 454 | |
458 | space.machine().scheduler().timer_set(attotime::zero, FUNC(update_signal), data, &state->m_blank); | |
455 | space.machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(vectrex_state::update_signal),state), data, &state->m_blank); | |
459 | 456 | state->m_cb2 = data; |
460 | 457 | } |
461 | 458 | } |
r18112 | r18113 | |
494 | 491 | m_y_max = visarea.max_y << 16; |
495 | 492 | |
496 | 493 | vector_add_point_function = vectrex_add_point; |
497 | m_refresh = machine().scheduler().timer_alloc(FUNC(vectrex_refresh)); | |
494 | m_refresh = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vectrex_state::vectrex_refresh),this)); | |
498 | 495 | |
499 | 496 | VIDEO_START_CALL_LEGACY(vector); |
500 | 497 | } |
r18112 | r18113 | |
---|---|---|
15 | 15 | #include "includes/changela.h" |
16 | 16 | |
17 | 17 | |
18 | static TIMER_CALLBACK( changela_scanline_callback ); | |
19 | 18 | |
19 | ||
20 | 20 | void changela_state::video_start() |
21 | 21 | { |
22 | 22 | |
r18112 | r18113 | |
28 | 28 | machine().primary_screen->register_screen_bitmap(m_tree0_bitmap); |
29 | 29 | machine().primary_screen->register_screen_bitmap(m_tree1_bitmap); |
30 | 30 | |
31 | m_scanline_timer = machine().scheduler().timer_alloc(FUNC(changela_scanline_callback)); | |
31 | m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(changela_state::changela_scanline_callback),this)); | |
32 | 32 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(30), 30); |
33 | 33 | |
34 | 34 | save_pointer(NAME(m_memory_devices), 4 * 0x800); |
r18112 | r18113 | |
644 | 644 | written back to RAM |
645 | 645 | */ |
646 | 646 | |
647 | ||
647 | TIMER_CALLBACK_MEMBER(changela_state::changela_scanline_callback) | |
648 | 648 | { |
649 | changela_state *state = machine.driver_data<changela_state>(); | |
650 | 649 | int sy = param; |
651 | 650 | int sx; |
652 | 651 | |
653 | 652 | /* clear the current scanline first */ |
654 | 653 | const rectangle rect(0, 255, sy, sy); |
655 | state->m_river_bitmap.fill(0x00, rect); | |
656 | state->m_obj0_bitmap.fill(0x00, rect); | |
657 | state->m_tree0_bitmap.fill(0x00, rect); | |
658 | state->m_tree1_bitmap.fill(0x00, rect); | |
654 | m_river_bitmap.fill(0x00, rect); | |
655 | m_obj0_bitmap.fill(0x00, rect); | |
656 | m_tree0_bitmap.fill(0x00, rect); | |
657 | m_tree1_bitmap.fill(0x00, rect); | |
659 | 658 | |
660 | draw_river(machine, state->m_river_bitmap, sy); | |
661 | draw_obj0(machine, state->m_obj0_bitmap, sy); | |
662 | draw_tree(machine, state->m_tree0_bitmap, sy, 0); | |
663 | draw_tree(machine, state->m_tree1_bitmap, sy, 1); | |
659 | draw_river(machine(), m_river_bitmap, sy); | |
660 | draw_obj0(machine(), m_obj0_bitmap, sy); | |
661 | draw_tree(machine(), m_tree0_bitmap, sy, 0); | |
662 | draw_tree(machine(), m_tree1_bitmap, sy, 1); | |
664 | 663 | |
665 | 664 | /* Collision Detection */ |
666 | 665 | for (sx = 1; sx < 256; sx++) |
667 | 666 | { |
668 | 667 | int riv_col, prev_col; |
669 | 668 | |
670 | if ((state->m_river_bitmap.pix16(sy, sx) == 0x08) | |
671 | || (state->m_river_bitmap.pix16(sy, sx) == 0x09) | |
672 | || (state->m_river_bitmap.pix16(sy, sx) == 0x0a)) | |
669 | if ((m_river_bitmap.pix16(sy, sx) == 0x08) | |
670 | || (m_river_bitmap.pix16(sy, sx) == 0x09) | |
671 | || (m_river_bitmap.pix16(sy, sx) == 0x0a)) | |
673 | 672 | riv_col = 1; |
674 | 673 | else |
675 | 674 | riv_col = 0; |
676 | 675 | |
677 | if ((state->m_river_bitmap.pix16(sy, sx-1) == 0x08) | |
678 | || (state->m_river_bitmap.pix16(sy, sx-1) == 0x09) | |
679 | || (state->m_river_bitmap.pix16(sy, sx-1) == 0x0a)) | |
676 | if ((m_river_bitmap.pix16(sy, sx-1) == 0x08) | |
677 | || (m_river_bitmap.pix16(sy, sx-1) == 0x09) | |
678 | || (m_river_bitmap.pix16(sy, sx-1) == 0x0a)) | |
680 | 679 | prev_col = 1; |
681 | 680 | else |
682 | 681 | prev_col = 0; |
683 | 682 | |
684 | if ( | |
683 | if (m_obj0_bitmap.pix16(sy, sx) == 0x14) /* Car Outline Color */ | |
685 | 684 | { |
686 | 685 | /* Tree 0 Collision */ |
687 | if (state->m_tree0_bitmap.pix16(sy, sx) != 0) | |
688 | state->m_tree0_col = 1; | |
686 | if (m_tree0_bitmap.pix16(sy, sx) != 0) | |
687 | m_tree0_col = 1; | |
689 | 688 | |
690 | 689 | /* Tree 1 Collision */ |
691 | if (state->m_tree1_bitmap.pix16(sy, sx) != 0) | |
692 | state->m_tree1_col = 1; | |
690 | if (m_tree1_bitmap.pix16(sy, sx) != 0) | |
691 | m_tree1_col = 1; | |
693 | 692 | |
694 | 693 | /* Hit Right Bank */ |
695 | 694 | if (riv_col == 0 && prev_col == 1) |
696 | | |
695 | m_right_bank_col = 1; | |
697 | 696 | |
698 | 697 | /* Hit Left Bank */ |
699 | 698 | if (riv_col == 1 && prev_col == 0) |
700 | | |
699 | m_left_bank_col = 1; | |
701 | 700 | |
702 | 701 | /* Boat Hit Shore */ |
703 | 702 | if (riv_col == 1) |
704 | | |
703 | m_boat_shore_col = 1; | |
705 | 704 | } |
706 | 705 | } |
707 | if (! | |
706 | if (!m_tree_collision_reset) | |
708 | 707 | { |
709 | state->m_tree0_col = 0; | |
710 | state->m_tree1_col = 0; | |
708 | m_tree0_col = 0; | |
709 | m_tree1_col = 0; | |
711 | 710 | } |
712 | if (! | |
711 | if (!m_collision_reset) | |
713 | 712 | { |
714 | state->m_left_bank_col = 0; | |
715 | state->m_right_bank_col = 0; | |
716 | state->m_boat_shore_col = 0; | |
713 | m_left_bank_col = 0; | |
714 | m_right_bank_col = 0; | |
715 | m_boat_shore_col = 0; | |
717 | 716 | } |
718 | 717 | |
719 | 718 | sy++; |
720 | 719 | if (sy > 256) sy = 30; |
721 | | |
720 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(sy), sy); | |
722 | 721 | } |
723 | 722 | |
724 | 723 | UINT32 changela_state::screen_update_changela(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
r18112 | r18113 | |
---|---|---|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | ||
27 | TIMER_CALLBACK_MEMBER(triplhnt_state::triplhnt_hit_callback) | |
28 | 28 | { |
29 | triplhnt_set_collision(machine, param); | |
29 | triplhnt_set_collision(machine(), param); | |
30 | 30 | } |
31 | 31 | |
32 | 32 | |
r18112 | r18113 | |
99 | 99 | } |
100 | 100 | |
101 | 101 | if (hit_line != 999 && hit_code != 999) |
102 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(hit_line), FUNC(triplhnt_hit_callback), hit_code); | |
102 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(hit_line), timer_expired_delegate(FUNC(triplhnt_state::triplhnt_hit_callback),state), hit_code); | |
103 | 103 | } |
104 | 104 | |
105 | 105 |
r18112 | r18113 | |
---|---|---|
62 | 62 | #endif |
63 | 63 | } |
64 | 64 | |
65 | ||
65 | TIMER_CALLBACK_MEMBER(lockon_state::cursor_callback) | |
66 | 66 | { |
67 | lockon_state *state = machine.driver_data<lockon_state>(); | |
68 | 67 | |
69 | if (state->m_main_inten) | |
70 | state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); | |
68 | if (m_main_inten) | |
69 | m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xff); | |
71 | 70 | |
72 | | |
71 | m_cursor_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); | |
73 | 72 | } |
74 | 73 | |
75 | 74 | /************************************* |
r18112 | r18113 | |
281 | 280 | m_ground_ctrl = data & 0xff; |
282 | 281 | } |
283 | 282 | |
284 | ||
283 | TIMER_CALLBACK_MEMBER(lockon_state::bufend_callback) | |
285 | 284 | { |
286 | lockon_state *state = machine.driver_data<lockon_state>(); | |
287 | state->m_ground->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff); | |
288 | state->m_object->execute().set_input_line(NEC_INPUT_LINE_POLL, ASSERT_LINE); | |
285 | m_ground->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff); | |
286 | m_object->execute().set_input_line(NEC_INPUT_LINE_POLL, ASSERT_LINE); | |
289 | 287 | } |
290 | 288 | |
291 | 289 | /* Get data for a each 8x8x3 ground tile */ |
r18112 | r18113 | |
909 | 907 | m_obj_pal_ram = auto_alloc_array(machine(), UINT8, 2048); |
910 | 908 | |
911 | 909 | /* Timer for ground display list callback */ |
912 | m_bufend_timer = machine().scheduler().timer_alloc(FUNC(bufend_callback)); | |
910 | m_bufend_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(lockon_state::bufend_callback),this)); | |
913 | 911 | |
914 | 912 | /* Timer for the CRTC cursor pulse */ |
915 | m_cursor_timer = machine().scheduler().timer_alloc(FUNC(cursor_callback)); | |
913 | m_cursor_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(lockon_state::cursor_callback),this)); | |
916 | 914 | m_cursor_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); |
917 | 915 | |
918 | 916 | save_item(NAME(*m_back_buffer)); |
r18112 | r18113 | |
---|---|---|
45 | 45 | * |
46 | 46 | *************************************/ |
47 | 47 | |
48 | ||
48 | TIMER_CALLBACK_MEMBER(mystston_state::interrupt_callback) | |
49 | 49 | { |
50 | mystston_state *state = machine.driver_data<mystston_state>(); | |
51 | 50 | int scanline = param; |
52 | 51 | |
53 | mystston_on_scanline_interrupt(machine); | |
52 | mystston_on_scanline_interrupt(machine()); | |
54 | 53 | |
55 | 54 | scanline = scanline + 16; |
56 | 55 | if (scanline >= VTOTAL) |
57 | 56 | scanline = FIRST_INT_VPOS; |
58 | 57 | |
59 | 58 | /* the vertical synch chain is clocked by H256 -- this is probably not important, but oh well */ |
60 | | |
59 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline - 1, INT_HPOS), scanline); | |
61 | 60 | } |
62 | 61 | |
63 | 62 | |
r18112 | r18113 | |
224 | 223 | m_fg_tilemap->set_transparent_pen(0); |
225 | 224 | |
226 | 225 | /* create the interrupt timer */ |
227 | m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(interrupt_callback)); | |
226 | m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mystston_state::interrupt_callback),this)); | |
228 | 227 | } |
229 | 228 | |
230 | 229 |
r18112 | r18113 | |
---|---|---|
358 | 358 | * |
359 | 359 | *************************************/ |
360 | 360 | |
361 | ||
361 | TIMER_CALLBACK_MEMBER(midyunit_state::dma_callback) | |
362 | 362 | { |
363 | midyunit_state *state = machine.driver_data<midyunit_state>(); | |
364 | state->m_dma_register[DMA_COMMAND] &= ~0x8000; /* tell the cpu we're done */ | |
365 | machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
363 | m_dma_register[DMA_COMMAND] &= ~0x8000; /* tell the cpu we're done */ | |
364 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
366 | 365 | } |
367 | 366 | |
368 | 367 | |
r18112 | r18113 | |
516 | 515 | } |
517 | 516 | |
518 | 517 | /* signal we're done */ |
519 | machine().scheduler().timer_set(attotime::from_nsec(41 * dma_state.width * dma_state.height), FUNC(dma_callback)); | |
518 | machine().scheduler().timer_set(attotime::from_nsec(41 * dma_state.width * dma_state.height), timer_expired_delegate(FUNC(midyunit_state::dma_callback),this)); | |
520 | 519 | |
521 | 520 | g_profiler.stop(); |
522 | 521 | } |
r18112 | r18113 | |
529 | 528 | * |
530 | 529 | *************************************/ |
531 | 530 | |
532 | ||
531 | TIMER_CALLBACK_MEMBER(midyunit_state::autoerase_line) | |
533 | 532 | { |
534 | midyunit_state *state = machine.driver_data<midyunit_state>(); | |
535 | 533 | int scanline = param; |
536 | 534 | |
537 | if (state->m_autoerase_enable && scanline >= 0 && scanline < 510) | |
538 | memcpy(&state->m_local_videoram[512 * scanline], &state->m_local_videoram[512 * (510 + (scanline & 1))], 512 * sizeof(UINT16)); | |
535 | if (m_autoerase_enable && scanline >= 0 && scanline < 510) | |
536 | memcpy(&m_local_videoram[512 * scanline], &m_local_videoram[512 * (510 + (scanline & 1))], 512 * sizeof(UINT16)); | |
539 | 537 | } |
540 | 538 | |
541 | 539 | |
r18112 | r18113 | |
552 | 550 | dest[x] = state->m_pen_map[src[coladdr++ & 0x1ff]]; |
553 | 551 | |
554 | 552 | /* handle autoerase on the previous line */ |
555 | autoerase_line( | |
553 | state->autoerase_line(NULL, params->rowaddr - 1); | |
556 | 554 | |
557 | 555 | /* if this is the last update of the screen, set a timer to clear out the final line */ |
558 | 556 | /* (since we update one behind) */ |
559 | 557 | if (scanline == screen.visible_area().max_y) |
560 | screen.machine().scheduler().timer_set(screen.time_until_pos(scanline + 1), FUNC(autoerase_line), params->rowaddr); | |
558 | screen.machine().scheduler().timer_set(screen.time_until_pos(scanline + 1), timer_expired_delegate(FUNC(midyunit_state::autoerase_line),state), params->rowaddr); | |
561 | 559 | } |
r18112 | r18113 | |
---|---|---|
200 | 200 | state->m_tmpbitmap[vram].pix16(y, x) = color; |
201 | 201 | } |
202 | 202 | |
203 | ||
203 | TIMER_CALLBACK_MEMBER(nbmj9195_state::blitter_timer_callback) | |
204 | 204 | { |
205 | nbmj9195_state *state = machine.driver_data<nbmj9195_state>(); | |
206 | state->m_nb19010_busyflag = 1; | |
205 | m_nb19010_busyflag = 1; | |
207 | 206 | } |
208 | 207 | |
209 | 208 | static void nbmj9195_gfxdraw(running_machine &machine, int vram) |
r18112 | r18113 | |
364 | 363 | state->m_nb19010_busyflag = 0; |
365 | 364 | |
366 | 365 | /* 1650ns per count */ |
367 | machine.scheduler().timer_set(attotime::from_nsec(state->m_nb19010_busyctr * 1650), FUNC(blitter_timer_callback)); | |
366 | machine.scheduler().timer_set(attotime::from_nsec(state->m_nb19010_busyctr * 1650), timer_expired_delegate(FUNC(nbmj9195_state::blitter_timer_callback),state)); | |
368 | 367 | } |
369 | 368 | |
370 | 369 | /****************************************************************************** |
r18112 | r18113 | |
---|---|---|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
74 | ||
74 | TIMER_CALLBACK_MEMBER(dcheese_state::blitter_scanline_callback) | |
75 | 75 | { |
76 | dcheese_signal_irq(machine, 3); | |
77 | update_scanline_irq(machine); | |
76 | dcheese_signal_irq(machine(), 3); | |
77 | update_scanline_irq(machine()); | |
78 | 78 | } |
79 | 79 | |
80 | 80 | |
81 | ||
81 | TIMER_CALLBACK_MEMBER(dcheese_state::dcheese_signal_irq_callback) | |
82 | 82 | { |
83 | dcheese_signal_irq(machine, param); | |
83 | dcheese_signal_irq(machine(), param); | |
84 | 84 | } |
85 | 85 | |
86 | 86 | |
r18112 | r18113 | |
97 | 97 | m_dstbitmap = auto_bitmap_ind16_alloc(machine(), DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT); |
98 | 98 | |
99 | 99 | /* create a timer */ |
100 | m_blitter_timer = machine().scheduler().timer_alloc(FUNC(blitter_scanline_callback)); | |
100 | m_blitter_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dcheese_state::blitter_scanline_callback),this)); | |
101 | 101 | |
102 | 102 | /* register for saving */ |
103 | 103 | save_item(NAME(m_blitter_color)); |
r18112 | r18113 | |
149 | 149 | memset(&state->m_dstbitmap->pix16(y % DSTBITMAP_HEIGHT), 0, DSTBITMAP_WIDTH * 2); |
150 | 150 | |
151 | 151 | /* signal an IRQ when done (timing is just a guess) */ |
152 | machine.scheduler().timer_set(machine.primary_screen->scan_period(), FUNC(dcheese_signal_irq_callback), 1); | |
152 | machine.scheduler().timer_set(machine.primary_screen->scan_period(), timer_expired_delegate(FUNC(dcheese_state::dcheese_signal_irq_callback),state), 1); | |
153 | 153 | } |
154 | 154 | |
155 | 155 | |
r18112 | r18113 | |
204 | 204 | } |
205 | 205 | |
206 | 206 | /* signal an IRQ when done (timing is just a guess) */ |
207 | machine.scheduler().timer_set(machine.primary_screen->scan_period() / 2, FUNC(dcheese_signal_irq_callback), 2); | |
207 | machine.scheduler().timer_set(machine.primary_screen->scan_period() / 2, timer_expired_delegate(FUNC(dcheese_state::dcheese_signal_irq_callback),state), 2); | |
208 | 208 | |
209 | 209 | /* these extra parameters are written but they are always zero, so I don't know what they do */ |
210 | 210 | if (state->m_blitter_xparam[8] != 0 || state->m_blitter_xparam[9] != 0 || state->m_blitter_xparam[10] != 0 || state->m_blitter_xparam[11] != 0 || |
r18112 | r18113 | |
---|---|---|
223 | 223 | } |
224 | 224 | |
225 | 225 | |
226 | ||
226 | TIMER_CALLBACK_MEMBER(neogeo_state::auto_animation_timer_callback) | |
227 | 227 | { |
228 | neogeo_state *state = machine.driver_data<neogeo_state>(); | |
229 | if (state->m_auto_animation_frame_counter == 0) | |
228 | if (m_auto_animation_frame_counter == 0) | |
230 | 229 | { |
231 | state->m_auto_animation_frame_counter = state->m_auto_animation_speed; | |
232 | state->m_auto_animation_counter += 1; | |
230 | m_auto_animation_frame_counter = m_auto_animation_speed; | |
231 | m_auto_animation_counter += 1; | |
233 | 232 | } |
234 | 233 | else |
235 | | |
234 | m_auto_animation_frame_counter = m_auto_animation_frame_counter - 1; | |
236 | 235 | |
237 | | |
236 | m_auto_animation_timer->adjust(machine().primary_screen->time_until_pos(NEOGEO_VSSTART)); | |
238 | 237 | } |
239 | 238 | |
240 | 239 | |
241 | 240 | static void create_auto_animation_timer( running_machine &machine ) |
242 | 241 | { |
243 | 242 | neogeo_state *state = machine.driver_data<neogeo_state>(); |
244 | state->m_auto_animation_timer = machine.scheduler().timer_alloc(FUNC(auto_animation_timer_callback)); | |
243 | state->m_auto_animation_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(neogeo_state::auto_animation_timer_callback),state)); | |
245 | 244 | } |
246 | 245 | |
247 | 246 | |
r18112 | r18113 | |
640 | 639 | } |
641 | 640 | |
642 | 641 | |
643 | ||
642 | TIMER_CALLBACK_MEMBER(neogeo_state::sprite_line_timer_callback) | |
644 | 643 | { |
645 | neogeo_state *state = machine.driver_data<neogeo_state>(); | |
646 | 644 | int scanline = param; |
647 | 645 | |
648 | 646 | /* we are at the beginning of a scanline - |
649 | 647 | we need to draw the previous scanline and parse the sprites on the current one */ |
650 | 648 | if (scanline != 0) |
651 | machine.primary_screen->update_partial(scanline - 1); | |
649 | machine().primary_screen->update_partial(scanline - 1); | |
652 | 650 | |
653 | parse_sprites(machine, scanline); | |
651 | parse_sprites(machine(), scanline); | |
654 | 652 | |
655 | 653 | /* let's come back at the beginning of the next line */ |
656 | 654 | scanline = (scanline + 1) % NEOGEO_VTOTAL; |
657 | 655 | |
658 | | |
656 | m_sprite_line_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline); | |
659 | 657 | } |
660 | 658 | |
661 | 659 | |
662 | 660 | static void create_sprite_line_timer( running_machine &machine ) |
663 | 661 | { |
664 | 662 | neogeo_state *state = machine.driver_data<neogeo_state>(); |
665 | state->m_sprite_line_timer = machine.scheduler().timer_alloc(FUNC(sprite_line_timer_callback)); | |
663 | state->m_sprite_line_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(neogeo_state::sprite_line_timer_callback),state)); | |
666 | 664 | } |
667 | 665 | |
668 | 666 |
r18112 | r18113 | |
---|---|---|
1292 | 1292 | #endif |
1293 | 1293 | } |
1294 | 1294 | |
1295 | ||
1295 | TIMER_CALLBACK_MEMBER(dc_state::transfer_opaque_list_irq) | |
1296 | 1296 | { |
1297 | dc_state *state = machine.driver_data<dc_state>(); | |
1298 | 1297 | |
1299 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_OPLST; | |
1300 | dc_update_interrupt_status(machine); | |
1298 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_OPLST; | |
1299 | dc_update_interrupt_status(machine()); | |
1301 | 1300 | } |
1302 | 1301 | |
1303 | ||
1302 | TIMER_CALLBACK_MEMBER(dc_state::transfer_opaque_modifier_volume_list_irq) | |
1304 | 1303 | { |
1305 | dc_state *state = machine.driver_data<dc_state>(); | |
1306 | 1304 | |
1307 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_OPMV; | |
1308 | dc_update_interrupt_status(machine); | |
1305 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_OPMV; | |
1306 | dc_update_interrupt_status(machine()); | |
1309 | 1307 | } |
1310 | 1308 | |
1311 | ||
1309 | TIMER_CALLBACK_MEMBER(dc_state::transfer_translucent_list_irq) | |
1312 | 1310 | { |
1313 | dc_state *state = machine.driver_data<dc_state>(); | |
1314 | 1311 | |
1315 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_TRLST; | |
1316 | dc_update_interrupt_status(machine); | |
1312 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_TRLST; | |
1313 | dc_update_interrupt_status(machine()); | |
1317 | 1314 | } |
1318 | 1315 | |
1319 | ||
1316 | TIMER_CALLBACK_MEMBER(dc_state::transfer_translucent_modifier_volume_list_irq) | |
1320 | 1317 | { |
1321 | dc_state *state = machine.driver_data<dc_state>(); | |
1322 | 1318 | |
1323 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_TRMV; | |
1324 | dc_update_interrupt_status(machine); | |
1319 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOXFER_TRMV; | |
1320 | dc_update_interrupt_status(machine()); | |
1325 | 1321 | } |
1326 | 1322 | |
1327 | ||
1323 | TIMER_CALLBACK_MEMBER(dc_state::transfer_punch_through_list_irq) | |
1328 | 1324 | { |
1329 | dc_state *state = machine.driver_data<dc_state>(); | |
1330 | 1325 | |
1331 | state->dc_sysctrl_regs[SB_ISTNRM] |= (1 << 21); | |
1332 | dc_update_interrupt_status(machine); | |
1326 | dc_sysctrl_regs[SB_ISTNRM] |= (1 << 21); | |
1327 | dc_update_interrupt_status(machine()); | |
1333 | 1328 | } |
1334 | 1329 | |
1335 | 1330 | static void process_ta_fifo(running_machine& machine) |
r18112 | r18113 | |
1420 | 1415 | /* FIXME: timing of these */ |
1421 | 1416 | switch (state_ta.tafifo_listtype) |
1422 | 1417 | { |
1423 | case 0: machine.scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_opaque_list_irq)); break; | |
1424 | case 1: machine.scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_opaque_modifier_volume_list_irq)); break; | |
1425 | case 2: machine.scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_translucent_list_irq)); break; | |
1426 | case 3: machine.scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_translucent_modifier_volume_list_irq)); break; | |
1427 | case 4: machine.scheduler().timer_set(attotime::from_usec(100), FUNC(transfer_punch_through_list_irq)); break; | |
1418 | case 0: machine.scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(dc_state::transfer_opaque_list_irq),state)); break; | |
1419 | case 1: machine.scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(dc_state::transfer_opaque_modifier_volume_list_irq),state)); break; | |
1420 | case 2: machine.scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(dc_state::transfer_translucent_list_irq),state)); break; | |
1421 | case 3: machine.scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(dc_state::transfer_translucent_modifier_volume_list_irq),state)); break; | |
1422 | case 4: machine.scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(dc_state::transfer_punch_through_list_irq),state)); break; | |
1428 | 1423 | } |
1429 | 1424 | state_ta.tafifo_listtype= -1; // no list being received |
1430 | 1425 | state_ta.listtype_used |= (2+8); |
r18112 | r18113 | |
2498 | 2493 | pvr_parameterconfig[a] = pvr_parameterconfig[a-1]; |
2499 | 2494 | } |
2500 | 2495 | |
2501 | ||
2496 | TIMER_CALLBACK_MEMBER(dc_state::vbin) | |
2502 | 2497 | { |
2503 | dc_state *state = machine.driver_data<dc_state>(); | |
2498 | dc_state *state = machine().driver_data<dc_state>(); | |
2504 | 2499 | |
2505 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_IN; // V Blank-in interrupt | |
2506 | dc_update_interrupt_status(machine); | |
2500 | dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_IN; // V Blank-in interrupt | |
2501 | dc_update_interrupt_status(machine()); | |
2507 | 2502 | |
2508 | | |
2503 | vbin_timer->adjust(machine().primary_screen->time_until_pos(spg_vblank_in_irq_line_num)); | |
2509 | 2504 | } |
2510 | 2505 | |
2511 | ||
2506 | TIMER_CALLBACK_MEMBER(dc_state::vbout) | |
2512 | 2507 | { |
2513 | dc_state *state = machine.driver_data<dc_state>(); | |
2508 | dc_state *state = machine().driver_data<dc_state>(); | |
2514 | 2509 | |
2515 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_OUT; // V Blank-out interrupt | |
2516 | dc_update_interrupt_status(machine); | |
2510 | dc_sysctrl_regs[SB_ISTNRM] |= IST_VBL_OUT; // V Blank-out interrupt | |
2511 | dc_update_interrupt_status(machine()); | |
2517 | 2512 | |
2518 | | |
2513 | vbout_timer->adjust(machine().primary_screen->time_until_pos(spg_vblank_out_irq_line_num)); | |
2519 | 2514 | } |
2520 | 2515 | |
2521 | ||
2516 | TIMER_CALLBACK_MEMBER(dc_state::hbin) | |
2522 | 2517 | { |
2523 | dc_state *state = machine.driver_data<dc_state>(); | |
2518 | dc_state *state = machine().driver_data<dc_state>(); | |
2524 | 2519 | |
2525 | 2520 | if(spg_hblank_int_mode & 1) |
2526 | 2521 | { |
2527 | if(s | |
2522 | if(scanline == next_y) | |
2528 | 2523 | { |
2529 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_HBL_IN; // H Blank-in interrupt | |
2530 | dc_update_interrupt_status(machine); | |
2531 | state->next_y+=spg_line_comp_val; | |
2524 | dc_sysctrl_regs[SB_ISTNRM] |= IST_HBL_IN; // H Blank-in interrupt | |
2525 | dc_update_interrupt_status(machine()); | |
2526 | next_y+=spg_line_comp_val; | |
2532 | 2527 | } |
2533 | 2528 | } |
2534 | else if((s | |
2529 | else if((scanline == spg_line_comp_val) || (spg_hblank_int_mode & 2)) | |
2535 | 2530 | { |
2536 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_HBL_IN; // H Blank-in interrupt | |
2537 | dc_update_interrupt_status(machine); | |
2531 | dc_sysctrl_regs[SB_ISTNRM] |= IST_HBL_IN; // H Blank-in interrupt | |
2532 | dc_update_interrupt_status(machine()); | |
2538 | 2533 | } |
2539 | 2534 | |
2540 | // printf("hbin on s | |
2535 | // printf("hbin on scanline %d\n",scanline); | |
2541 | 2536 | |
2542 | s | |
2537 | scanline++; | |
2543 | 2538 | |
2544 | if(s | |
2539 | if(scanline >= spg_vblank_in_irq_line_num) | |
2545 | 2540 | { |
2546 | state->scanline = 0; | |
2547 | state->next_y = spg_line_comp_val; | |
2541 | scanline = 0; | |
2542 | next_y = spg_line_comp_val; | |
2548 | 2543 | } |
2549 | 2544 | |
2550 | | |
2545 | hbin_timer->adjust(machine().primary_screen->time_until_pos(scanline, spg_hblank_in_irq-1)); | |
2551 | 2546 | } |
2552 | 2547 | |
2553 | 2548 | |
2554 | 2549 | |
2555 | ||
2550 | TIMER_CALLBACK_MEMBER(dc_state::endofrender_video) | |
2556 | 2551 | { |
2557 | dc_state *state = machine.driver_data<dc_state>(); | |
2558 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_VIDEO;// VIDEO end of render | |
2559 | dc_update_interrupt_status(machine); | |
2560 | state->endofrender_timer_video->adjust(attotime::never); | |
2552 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_VIDEO;// VIDEO end of render | |
2553 | dc_update_interrupt_status(machine()); | |
2554 | endofrender_timer_video->adjust(attotime::never); | |
2561 | 2555 | } |
2562 | 2556 | |
2563 | ||
2557 | TIMER_CALLBACK_MEMBER(dc_state::endofrender_tsp) | |
2564 | 2558 | { |
2565 | dc_state *state = machine.driver_data<dc_state>(); | |
2566 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_TSP; // TSP end of render | |
2567 | dc_update_interrupt_status(machine); | |
2559 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_TSP; // TSP end of render | |
2560 | dc_update_interrupt_status(machine()); | |
2568 | 2561 | |
2569 | state->endofrender_timer_tsp->adjust(attotime::never); | |
2570 | state->endofrender_timer_video->adjust(attotime::from_usec(500) ); | |
2562 | endofrender_timer_tsp->adjust(attotime::never); | |
2563 | endofrender_timer_video->adjust(attotime::from_usec(500) ); | |
2571 | 2564 | } |
2572 | 2565 | |
2573 | ||
2566 | TIMER_CALLBACK_MEMBER(dc_state::endofrender_isp) | |
2574 | 2567 | { |
2575 | dc_state *state = machine.driver_data<dc_state>(); | |
2576 | state->dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_ISP; // ISP end of render | |
2577 | dc_update_interrupt_status(machine); | |
2568 | dc_sysctrl_regs[SB_ISTNRM] |= IST_EOR_ISP; // ISP end of render | |
2569 | dc_update_interrupt_status(machine()); | |
2578 | 2570 | |
2579 | state->endofrender_timer_isp->adjust(attotime::never); | |
2580 | state->endofrender_timer_tsp->adjust(attotime::from_usec(500) ); | |
2571 | endofrender_timer_isp->adjust(attotime::never); | |
2572 | endofrender_timer_tsp->adjust(attotime::from_usec(500) ); | |
2581 | 2573 | } |
2582 | 2574 | |
2583 | 2575 | |
r18112 | r18113 | |
2613 | 2605 | |
2614 | 2606 | computedilated(); |
2615 | 2607 | |
2616 | vbout_timer = machine().scheduler().timer_alloc(FUNC(vbout)); | |
2608 | vbout_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dc_state::vbout),this)); | |
2617 | 2609 | vbout_timer->adjust(machine().primary_screen->time_until_pos(spg_vblank_out_irq_line_num_new)); |
2618 | 2610 | |
2619 | vbin_timer = machine().scheduler().timer_alloc(FUNC(vbin)); | |
2611 | vbin_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dc_state::vbin),this)); | |
2620 | 2612 | vbin_timer->adjust(machine().primary_screen->time_until_pos(spg_vblank_in_irq_line_num_new)); |
2621 | 2613 | |
2622 | hbin_timer = machine().scheduler().timer_alloc(FUNC(hbin)); | |
2614 | hbin_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dc_state::hbin),this)); | |
2623 | 2615 | hbin_timer->adjust(machine().primary_screen->time_until_pos(0, spg_hblank_in_irq_new-1)); |
2624 | 2616 | |
2625 | 2617 | scanline = 0; |
2626 | 2618 | next_y = 0; |
2627 | 2619 | |
2628 | endofrender_timer_isp = machine().scheduler().timer_alloc(FUNC(endofrender_isp)); | |
2629 | endofrender_timer_tsp = machine().scheduler().timer_alloc(FUNC(endofrender_tsp)); | |
2630 | endofrender_timer_video = machine().scheduler().timer_alloc(FUNC(endofrender_video)); | |
2620 | endofrender_timer_isp = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dc_state::endofrender_isp),this)); | |
2621 | endofrender_timer_tsp = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dc_state::endofrender_tsp),this)); | |
2622 | endofrender_timer_video = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dc_state::endofrender_video),this)); | |
2631 | 2623 | |
2632 | 2624 | endofrender_timer_isp->adjust(attotime::never); |
2633 | 2625 | endofrender_timer_tsp->adjust(attotime::never); |
r18112 | r18113 | |
---|---|---|
588 | 588 | * |
589 | 589 | *************************************/ |
590 | 590 | |
591 | ||
591 | TIMER_CALLBACK_MEMBER(midtunit_state::dma_callback) | |
592 | 592 | { |
593 | 593 | dma_register[DMA_COMMAND] &= ~0x8000; /* tell the cpu we're done */ |
594 | machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
594 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
595 | 595 | } |
596 | 596 | |
597 | 597 | |
r18112 | r18113 | |
791 | 791 | |
792 | 792 | /* signal we're done */ |
793 | 793 | skipdma: |
794 | machine().scheduler().timer_set(attotime::from_nsec(41 * pixels), FUNC(dma_callback)); | |
794 | machine().scheduler().timer_set(attotime::from_nsec(41 * pixels), timer_expired_delegate(FUNC(midtunit_state::dma_callback),this)); | |
795 | 795 | |
796 | 796 | g_profiler.stop(); |
797 | 797 | } |
r18112 | r18113 | |
---|---|---|
171 | 171 | state->m_tmpbitmap[vram].pix16(y, x) = color; |
172 | 172 | } |
173 | 173 | |
174 | ||
174 | TIMER_CALLBACK_MEMBER(niyanpai_state::blitter_timer_callback) | |
175 | 175 | { |
176 | niyanpai_state *state = machine.driver_data<niyanpai_state>(); | |
177 | state->m_nb19010_busyflag = 1; | |
176 | m_nb19010_busyflag = 1; | |
178 | 177 | } |
179 | 178 | |
180 | 179 | static void niyanpai_gfxdraw(running_machine &machine, int vram) |
r18112 | r18113 | |
330 | 329 | } |
331 | 330 | |
332 | 331 | state->m_nb19010_busyflag = 0; |
333 | machine.scheduler().timer_set(attotime::from_nsec(1000 * state->m_nb19010_busyctr), FUNC(blitter_timer_callback)); | |
332 | machine.scheduler().timer_set(attotime::from_nsec(1000 * state->m_nb19010_busyctr), timer_expired_delegate(FUNC(niyanpai_state::blitter_timer_callback),state)); | |
334 | 333 | } |
335 | 334 | |
336 | 335 | /****************************************************************************** |
r18112 | r18113 | |
---|---|---|
15 | 15 | #include "emu.h" |
16 | 16 | #include "includes/twin16.h" |
17 | 17 | |
18 | static TIMER_CALLBACK( twin16_sprite_tick ); | |
19 | 18 | |
20 | 19 | |
20 | ||
21 | 21 | enum |
22 | 22 | { |
23 | 23 | TWIN16_SCREEN_FLIPY = 0x01, |
r18112 | r18113 | |
137 | 137 | return m_sprite_busy; |
138 | 138 | } |
139 | 139 | |
140 | ||
140 | TIMER_CALLBACK_MEMBER(twin16_state::twin16_sprite_tick) | |
141 | 141 | { |
142 | twin16_state *state = machine.driver_data<twin16_state>(); | |
143 | state->m_sprite_busy = 0; | |
142 | m_sprite_busy = 0; | |
144 | 143 | } |
145 | 144 | |
146 | 145 | static int twin16_set_sprite_timer( running_machine &machine ) |
r18112 | r18113 | |
500 | 499 | |
501 | 500 | memset(m_sprite_buffer,0xff,0x800*sizeof(UINT16)); |
502 | 501 | m_sprite_busy = 0; |
503 | m_sprite_timer = machine().scheduler().timer_alloc(FUNC(twin16_sprite_tick)); | |
502 | m_sprite_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(twin16_state::twin16_sprite_tick),this)); | |
504 | 503 | m_sprite_timer->adjust(attotime::never); |
505 | 504 | |
506 | 505 | /* register for savestates */ |
r18112 | r18113 | |
---|---|---|
58 | 58 | * |
59 | 59 | *************************************/ |
60 | 60 | |
61 | ||
61 | TIMER_CALLBACK_MEMBER(rpunch_state::crtc_interrupt_gen) | |
62 | 62 | { |
63 | rpunch_state *state = machine.driver_data<rpunch_state>(); | |
64 | machine.device("maincpu")->execute().set_input_line(1, HOLD_LINE); | |
63 | machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE); | |
65 | 64 | if (param != 0) |
66 | | |
65 | m_crtc_timer->adjust(machine().primary_screen->frame_period() / param, 0, machine().primary_screen->frame_period() / param); | |
67 | 66 | } |
68 | 67 | |
69 | 68 | |
r18112 | r18113 | |
80 | 79 | memset(m_bitmapram, 0xff, m_bitmapram.bytes()); |
81 | 80 | |
82 | 81 | /* reset the timer */ |
83 | m_crtc_timer = machine().scheduler().timer_alloc(FUNC(crtc_interrupt_gen)); | |
82 | m_crtc_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(rpunch_state::crtc_interrupt_gen),this)); | |
84 | 83 | } |
85 | 84 | |
86 | 85 |
r18112 | r18113 | |
---|---|---|
423 | 423 | } |
424 | 424 | |
425 | 425 | |
426 | ||
426 | TIMER_CALLBACK_MEMBER(tubep_state::sprite_timer_callback) | |
427 | 427 | { |
428 | machine.device("mcu")->execute().set_input_line(0, ASSERT_LINE); | |
428 | machine().device("mcu")->execute().set_input_line(0, ASSERT_LINE); | |
429 | 429 | } |
430 | 430 | |
431 | 431 | |
r18112 | r18113 | |
558 | 558 | machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE); |
559 | 559 | |
560 | 560 | /* 2.assert /SINT again after this time */ |
561 | machine().scheduler().timer_set( attotime::from_hz(19968000/8) * ((m_XSize+1)*(m_YSize+1)), FUNC(sprite_timer_callback)); | |
561 | machine().scheduler().timer_set( attotime::from_hz(19968000/8) * ((m_XSize+1)*(m_YSize+1)), timer_expired_delegate(FUNC(tubep_state::sprite_timer_callback),this)); | |
562 | 562 | |
563 | 563 | /* 3.clear of /SINT starts sprite drawing circuit */ |
564 | 564 | draw_sprite(machine()); |
r18112 | r18113 | |
---|---|---|
261 | 261 | |
262 | 262 | ***************************************************************************/ |
263 | 263 | |
264 | ||
264 | TIMER_CALLBACK_MEMBER(exidy_state::collision_irq_callback) | |
265 | 265 | { |
266 | 266 | /* latch the collision bits */ |
267 | latch_condition(machine, param); | |
267 | latch_condition(machine(), param); | |
268 | 268 | |
269 | 269 | /* set the IRQ line */ |
270 | machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
270 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
271 | 271 | } |
272 | 272 | |
273 | 273 | |
r18112 | r18113 | |
334 | 334 | |
335 | 335 | /* if we got one, trigger an interrupt */ |
336 | 336 | if ((current_collision_mask & state->m_collision_mask) && (count++ < 128)) |
337 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(org_1_x + sx, org_1_y + sy), FUNC(collision_irq_callback), current_collision_mask); | |
337 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(org_1_x + sx, org_1_y + sy), timer_expired_delegate(FUNC(exidy_state::collision_irq_callback),state), current_collision_mask); | |
338 | 338 | } |
339 | 339 | |
340 | 340 | if (state->m_motion_object_2_vid.pix16(sy, sx) != 0xff) |
r18112 | r18113 | |
342 | 342 | /* check for background collision (M2CHAR) */ |
343 | 343 | if (state->m_background_bitmap.pix16(org_2_y + sy, org_2_x + sx) != 0) |
344 | 344 | if ((state->m_collision_mask & 0x08) && (count++ < 128)) |
345 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(org_2_x + sx, org_2_y + sy), FUNC(collision_irq_callback), 0x08); | |
345 | machine.scheduler().timer_set(machine.primary_screen->time_until_pos(org_2_x + sx, org_2_y + sy), timer_expired_delegate(FUNC(exidy_state::collision_irq_callback),state), 0x08); | |
346 | 346 | } |
347 | 347 | } |
348 | 348 | } |
r18112 | r18113 | |
---|---|---|
56 | 56 | } |
57 | 57 | |
58 | 58 | |
59 | ||
59 | TIMER_CALLBACK_MEMBER(hyhoo_state::blitter_timer_callback) | |
60 | 60 | { |
61 | 61 | nb1413m3_busyflag = 1; |
62 | 62 | } |
r18112 | r18113 | |
218 | 218 | } |
219 | 219 | |
220 | 220 | nb1413m3_busyflag = 0; |
221 | machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, FUNC(blitter_timer_callback)); | |
221 | machine.scheduler().timer_set(attotime::from_hz(400000) * nb1413m3_busyctr, timer_expired_delegate(FUNC(hyhoo_state::blitter_timer_callback),state)); | |
222 | 222 | } |
223 | 223 | |
224 | 224 |
r18112 | r18113 | |
---|---|---|
119 | 119 | |
120 | 120 | |
121 | 121 | |
122 | static TIMER_CALLBACK( scanline_interrupt ); | |
123 | 122 | |
124 | 123 | |
125 | 124 | |
125 | ||
126 | 126 | /************************************* |
127 | 127 | * |
128 | 128 | * Macros and inlines |
r18112 | r18113 | |
193 | 193 | /* reset statics */ |
194 | 194 | memset(m_video, 0, 0x80); |
195 | 195 | |
196 | m_scanline_timer = machine().scheduler().timer_alloc(FUNC(scanline_interrupt)); | |
196 | m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(itech32_state::scanline_interrupt),this)); | |
197 | 197 | m_enable_latch[0] = 1; |
198 | 198 | m_enable_latch[1] = (m_planes > 1) ? 1 : 0; |
199 | 199 | } |
r18112 | r18113 | |
437 | 437 | } |
438 | 438 | |
439 | 439 | |
440 | ||
440 | TIMER_CALLBACK_MEMBER(itech32_state::scanline_interrupt) | |
441 | 441 | { |
442 | itech32_state *state = machine.driver_data<itech32_state>(); | |
443 | 442 | /* set timer for next frame */ |
444 | | |
443 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(VIDEO_INTSCANLINE)); | |
445 | 444 | |
446 | 445 | /* set the interrupt bit in the status reg */ |
447 | logerror("-------------- (DISPLAY INT @ %d) ----------------\n", machine.primary_screen->vpos()); | |
448 | state->VIDEO_INTSTATE |= VIDEOINT_SCANLINE; | |
446 | logerror("-------------- (DISPLAY INT @ %d) ----------------\n", machine().primary_screen->vpos()); | |
447 | VIDEO_INTSTATE |= VIDEOINT_SCANLINE; | |
449 | 448 | |
450 | 449 | /* update the interrupt state */ |
451 | update_interrupts(machine, 0); | |
450 | update_interrupts(machine(), 0); | |
452 | 451 | } |
453 | 452 | |
454 | 453 |
r18112 | r18113 | |
---|---|---|
23 | 23 | return ((m_timer_value / 10) << 4) | (m_timer_value % 10); |
24 | 24 | } |
25 | 25 | |
26 | ||
26 | TIMER_CALLBACK_MEMBER(dday_state::countdown_timer_callback) | |
27 | 27 | { |
28 | dday_state *state = machine.driver_data<dday_state>(); | |
29 | state->m_timer_value--; | |
28 | m_timer_value--; | |
30 | 29 | |
31 | if (state->m_timer_value < 0) | |
32 | state->m_timer_value = 99; | |
30 | if (m_timer_value < 0) | |
31 | m_timer_value = 99; | |
33 | 32 | } |
34 | 33 | |
35 | 34 | static void start_countdown_timer(running_machine &machine) |
r18112 | r18113 | |
38 | 37 | |
39 | 38 | state->m_timer_value = 0; |
40 | 39 | |
41 | machine.scheduler().timer_pulse(attotime::from_seconds(1), FUNC(countdown_timer_callback)); | |
40 | machine.scheduler().timer_pulse(attotime::from_seconds(1), timer_expired_delegate(FUNC(dday_state::countdown_timer_callback),state)); | |
42 | 41 | } |
43 | 42 | |
44 | 43 |
r18112 | r18113 | |
---|---|---|
31 | 31 | /* |
32 | 32 | TODO: Check interrupt timing from CRT config. Probably different between games. |
33 | 33 | */ |
34 | ||
34 | TIMER_CALLBACK_MEMBER(tx1_state::interrupt_callback) | |
35 | 35 | { |
36 | tx1_state *state = machine.driver_data<tx1_state>(); | |
37 | machine.device("main_cpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff); | |
38 | state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); | |
36 | machine().device("main_cpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff); | |
37 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); | |
39 | 38 | } |
40 | 39 | |
41 | 40 | |
r18112 | r18113 | |
1113 | 1112 | m_rod_bmp = auto_alloc_array(machine(), UINT8, 256 * 3 * 240); |
1114 | 1113 | |
1115 | 1114 | /* Set a timer to run the interrupts */ |
1116 | m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(interrupt_callback)); | |
1115 | m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tx1_state::interrupt_callback),this)); | |
1117 | 1116 | |
1118 | 1117 | /* /CUDISP CRTC interrupt */ |
1119 | 1118 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); |
r18112 | r18113 | |
3001 | 3000 | m_rod_bmp = auto_alloc_array(machine(), UINT8, 3 * 256 * 240); |
3002 | 3001 | |
3003 | 3002 | /* Set a timer to run the interrupts */ |
3004 | m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(interrupt_callback)); | |
3003 | m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tx1_state::interrupt_callback),this)); | |
3005 | 3004 | |
3006 | 3005 | /* /CUDISP CRTC interrupt */ |
3007 | 3006 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); |
r18112 | r18113 | |
3015 | 3014 | m_rod_bmp = auto_alloc_array(machine(), UINT8, 256 * 240); |
3016 | 3015 | |
3017 | 3016 | /* Set a timer to run the interrupts */ |
3018 | m_interrupt_timer = machine().scheduler().timer_alloc(FUNC(interrupt_callback)); | |
3017 | m_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tx1_state::interrupt_callback),this)); | |
3019 | 3018 | |
3020 | 3019 | /* /CUDISP CRTC interrupt */ |
3021 | 3020 | m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS)); |
r18112 | r18113 | |
---|---|---|
19 | 19 | * |
20 | 20 | *************************************/ |
21 | 21 | |
22 | ||
22 | TIMER_CALLBACK_MEMBER(segag80r_state::vblank_latch_clear) | |
23 | 23 | { |
24 | segag80r_state *state = machine.driver_data<segag80r_state>(); | |
25 | state->m_vblank_latch = 0; | |
24 | m_vblank_latch = 0; | |
26 | 25 | } |
27 | 26 | |
28 | 27 | |
r18112 | r18113 | |
32 | 31 | /* set a timer to mimic the 555 timer that drives the EDGINT signal */ |
33 | 32 | /* the 555 is run in monostable mode with R=56000 and C=1000pF */ |
34 | 33 | state->m_vblank_latch = 1; |
35 | machine.scheduler().timer_set(PERIOD_OF_555_MONOSTABLE(CAP_P(1000), RES_K(56)), FUNC(vblank_latch_clear)); | |
34 | machine.scheduler().timer_set(PERIOD_OF_555_MONOSTABLE(CAP_P(1000), RES_K(56)), timer_expired_delegate(FUNC(segag80r_state::vblank_latch_clear),state)); | |
36 | 35 | |
37 | 36 | /* latch the current flip state at the same time */ |
38 | 37 | state->m_video_flip = state->m_video_control & 1; |
r18112 | r18113 | |
---|---|---|
138 | 138 | } |
139 | 139 | |
140 | 140 | |
141 | ||
141 | TIMER_CALLBACK_MEMBER(gameplan_state::clear_screen_done_callback) | |
142 | 142 | { |
143 | gameplan_state *state = machine.driver_data<gameplan_state>(); | |
144 | 143 | |
145 | 144 | /* indicate that the we are done clearing the screen */ |
146 | | |
145 | m_via_0->write_ca1(0); | |
147 | 146 | } |
148 | 147 | |
149 | 148 | |
r18112 | r18113 | |
201 | 200 | /* set a timer for an arbitrarily short period. |
202 | 201 | The real time it takes to clear to screen is not |
203 | 202 | important to the software */ |
204 | device->machine().scheduler().synchronize(FUNC(clear_screen_done_callback)); | |
203 | device->machine().scheduler().synchronize(timer_expired_delegate(FUNC(gameplan_state::clear_screen_done_callback),driver_state)); | |
205 | 204 | |
206 | 205 | break; |
207 | 206 | } |
r18112 | r18113 | |
209 | 208 | } |
210 | 209 | |
211 | 210 | |
212 | ||
211 | TIMER_CALLBACK_MEMBER(gameplan_state::via_irq_delayed) | |
213 | 212 | { |
214 | gameplan_state *state = machine.driver_data<gameplan_state>(); | |
215 | state->m_maincpu->set_input_line(0, param); | |
213 | m_maincpu->set_input_line(0, param); | |
216 | 214 | } |
217 | 215 | |
218 | 216 | |
219 | 217 | static void via_irq(device_t *device, int state) |
220 | 218 | { |
219 | gameplan_state *driver_state = device->machine().driver_data<gameplan_state>(); | |
221 | 220 | /* Kaos sits in a tight loop polling the VIA irq flags register, but that register is |
222 | 221 | cleared by the irq handler. Therefore, I wait a bit before triggering the irq to |
223 | 222 | leave time for the program to see the flag change. */ |
224 | device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(via_irq_delayed), state); | |
223 | device->machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(gameplan_state::via_irq_delayed),driver_state), state); | |
225 | 224 | } |
226 | 225 | |
227 | 226 | |
r18112 | r18113 | |
262 | 261 | }; |
263 | 262 | |
264 | 263 | |
265 | ||
264 | TIMER_CALLBACK_MEMBER(gameplan_state::via_0_ca1_timer_callback) | |
266 | 265 | { |
267 | gameplan_state *state = machine.driver_data<gameplan_state>(); | |
268 | 266 | |
269 | 267 | /* !VBLANK is connected to CA1 */ |
270 | | |
268 | m_via_0->write_ca1(param); | |
271 | 269 | |
272 | 270 | if (param) |
273 | | |
271 | m_via_0_ca1_timer->adjust(machine().primary_screen->time_until_pos(VBSTART)); | |
274 | 272 | else |
275 | | |
273 | m_via_0_ca1_timer->adjust(machine().primary_screen->time_until_pos(VBEND), 1); | |
276 | 274 | } |
277 | 275 | |
278 | 276 | |
r18112 | r18113 | |
288 | 286 | m_videoram_size = (HBSTART - HBEND) * (VBSTART - VBEND); |
289 | 287 | m_videoram = auto_alloc_array(machine(), UINT8, m_videoram_size); |
290 | 288 | |
291 | m_via_0_ca1_timer = machine().scheduler().timer_alloc(FUNC(via_0_ca1_timer_callback)); | |
289 | m_via_0_ca1_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(gameplan_state::via_0_ca1_timer_callback),this)); | |
292 | 290 | |
293 | 291 | /* register for save states */ |
294 | 292 | save_pointer(NAME(m_videoram), m_videoram_size); |
r18112 | r18113 | |
---|---|---|
93 | 93 | * |
94 | 94 | *************************************/ |
95 | 95 | |
96 | ||
96 | TIMER_CALLBACK_MEMBER(lethalj_state::gen_ext1_int) | |
97 | 97 | { |
98 | machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
98 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
99 | 99 | } |
100 | 100 | |
101 | 101 | |
r18112 | r18113 | |
152 | 152 | else |
153 | 153 | do_blit(); |
154 | 154 | |
155 | machine().scheduler().timer_set(attotime::from_hz(XTAL_32MHz) * ((m_blitter_data[5] + 1) * (m_blitter_data[7] + 1)), FUNC(gen_ext1_int)); | |
155 | machine().scheduler().timer_set(attotime::from_hz(XTAL_32MHz) * ((m_blitter_data[5] + 1) * (m_blitter_data[7] + 1)), timer_expired_delegate(FUNC(lethalj_state::gen_ext1_int),this)); | |
156 | 156 | } |
157 | 157 | |
158 | 158 | /* clear the IRQ on offset 0 */ |
r18112 | r18113 | |
---|---|---|
7 | 7 | #include "emu.h" |
8 | 8 | #include "includes/starfire.h" |
9 | 9 | |
10 | static TIMER_CALLBACK( starfire_scanline_callback ); | |
11 | 10 | |
11 | ||
12 | 12 | /************************************* |
13 | 13 | * |
14 | 14 | * Initialize the video system |
r18112 | r18113 | |
19 | 19 | { |
20 | 20 | |
21 | 21 | machine().primary_screen->register_screen_bitmap(m_starfire_screen); |
22 | m_scanline_timer = machine().scheduler().timer_alloc(FUNC(starfire_scanline_callback)); | |
22 | m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(starfire_state::starfire_scanline_callback),this)); | |
23 | 23 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(STARFIRE_VBEND), STARFIRE_VBEND); |
24 | 24 | |
25 | 25 | /* register for state saving */ |
r18112 | r18113 | |
229 | 229 | } |
230 | 230 | } |
231 | 231 | |
232 | ||
232 | TIMER_CALLBACK_MEMBER(starfire_state::starfire_scanline_callback) | |
233 | 233 | { |
234 | starfire_state *state = machine.driver_data<starfire_state>(); | |
235 | 234 | pen_t pens[STARFIRE_NUM_PENS]; |
236 | 235 | int y = param; |
237 | 236 | |
238 | get_pens(machine, pens); | |
237 | get_pens(machine(), pens); | |
239 | 238 | |
240 | UINT8 *pix = &state->m_starfire_videoram[y]; | |
241 | UINT8 *col = &state->m_starfire_colorram[y]; | |
239 | UINT8 *pix = &m_starfire_videoram[y]; | |
240 | UINT8 *col = &m_starfire_colorram[y]; | |
242 | 241 | |
243 | 242 | for (int x = 0; x < 256; x += 8) |
244 | 243 | { |
245 | 244 | int data = pix[0]; |
246 | 245 | int color = col[0]; |
247 | 246 | |
248 | state->m_starfire_screen.pix32(y, x + 0) = pens[color | ((data >> 2) & 0x20)]; | |
249 | state->m_starfire_screen.pix32(y, x + 1) = pens[color | ((data >> 1) & 0x20)]; | |
250 | state->m_starfire_screen.pix32(y, x + 2) = pens[color | ((data >> 0) & 0x20)]; | |
251 | state->m_starfire_screen.pix32(y, x + 3) = pens[color | ((data << 1) & 0x20)]; | |
252 | state->m_starfire_screen.pix32(y, x + 4) = pens[color | ((data << 2) & 0x20)]; | |
253 | state->m_starfire_screen.pix32(y, x + 5) = pens[color | ((data << 3) & 0x20)]; | |
254 | state->m_starfire_screen.pix32(y, x + 6) = pens[color | ((data << 4) & 0x20)]; | |
255 | state->m_starfire_screen.pix32(y, x + 7) = pens[color | ((data << 5) & 0x20)]; | |
247 | m_starfire_screen.pix32(y, x + 0) = pens[color | ((data >> 2) & 0x20)]; | |
248 | m_starfire_screen.pix32(y, x + 1) = pens[color | ((data >> 1) & 0x20)]; | |
249 | m_starfire_screen.pix32(y, x + 2) = pens[color | ((data >> 0) & 0x20)]; | |
250 | m_starfire_screen.pix32(y, x + 3) = pens[color | ((data << 1) & 0x20)]; | |
251 | m_starfire_screen.pix32(y, x + 4) = pens[color | ((data << 2) & 0x20)]; | |
252 | m_starfire_screen.pix32(y, x + 5) = pens[color | ((data << 3) & 0x20)]; | |
253 | m_starfire_screen.pix32(y, x + 6) = pens[color | ((data << 4) & 0x20)]; | |
254 | m_starfire_screen.pix32(y, x + 7) = pens[color | ((data << 5) & 0x20)]; | |
256 | 255 | |
257 | 256 | pix += 256; |
258 | 257 | col += 256; |
r18112 | r18113 | |
260 | 259 | |
261 | 260 | y++; |
262 | 261 | if (y >= STARFIRE_VBSTART) y = STARFIRE_VBEND; |
263 | | |
262 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(y), y); | |
264 | 263 | } |
265 | 264 | |
266 | 265 | UINT32 starfire_state::screen_update_starfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
r18112 | r18113 | |
---|---|---|
32 | 32 | |
33 | 33 | static void drivfrcg_modify_color(UINT8 *color); |
34 | 34 | |
35 | static TIMER_CALLBACK( stars_blink_callback ); | |
36 | static TIMER_CALLBACK( stars_scroll_callback ); | |
37 | 35 | |
36 | ||
37 | ||
38 | 38 | void galaxold_init_stars(running_machine &machine, int colors_offset); |
39 | 39 | static void noop_draw_stars(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect); |
40 | 40 | void galaxold_draw_stars(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect); |
r18112 | r18113 | |
1367 | 1367 | |
1368 | 1368 | state->m_stars_on = 0; |
1369 | 1369 | state->m_stars_blink_state = 0; |
1370 | state->m_stars_blink_timer = machine.scheduler().timer_alloc(FUNC(stars_blink_callback)); | |
1371 | state->m_stars_scroll_timer = machine.scheduler().timer_alloc(FUNC(stars_scroll_callback)); | |
1370 | state->m_stars_blink_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(galaxold_state::stars_blink_callback),state)); | |
1371 | state->m_stars_scroll_timer = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(galaxold_state::stars_scroll_callback),state)); | |
1372 | 1372 | state->m_timer_adjusted = 0; |
1373 | 1373 | state->m_stars_colors_start = colors_offset; |
1374 | 1374 | |
r18112 | r18113 | |
1604 | 1604 | } |
1605 | 1605 | } |
1606 | 1606 | |
1607 | ||
1607 | TIMER_CALLBACK_MEMBER(galaxold_state::stars_blink_callback) | |
1608 | 1608 | { |
1609 | galaxold_state *state = machine.driver_data<galaxold_state>(); | |
1610 | state->m_stars_blink_state++; | |
1609 | m_stars_blink_state++; | |
1611 | 1610 | } |
1612 | 1611 | |
1613 | 1612 | static void start_stars_blink_timer(running_machine &machine, double ra, double rb, double c) |
r18112 | r18113 | |
1621 | 1620 | } |
1622 | 1621 | |
1623 | 1622 | |
1624 | ||
1623 | TIMER_CALLBACK_MEMBER(galaxold_state::stars_scroll_callback) | |
1625 | 1624 | { |
1626 | galaxold_state *state = machine.driver_data<galaxold_state>(); | |
1627 | if (state->m_stars_on) | |
1625 | if (m_stars_on) | |
1628 | 1626 | { |
1629 | | |
1627 | m_stars_scrollpos++; | |
1630 | 1628 | } |
1631 | 1629 | } |
1632 | 1630 |
r18112 | r18113 | |
---|---|---|
34 | 34 | * |
35 | 35 | *************************************/ |
36 | 36 | |
37 | ||
37 | TIMER_CALLBACK_MEMBER(midvunit_state::scanline_timer_cb) | |
38 | 38 | { |
39 | midvunit_state *state = machine.driver_data<midvunit_state>(); | |
40 | 39 | int scanline = param; |
41 | 40 | |
42 | 41 | if (scanline != -1) |
43 | 42 | { |
44 | machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
45 | state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline + 1), scanline); | |
46 | machine.scheduler().timer_set(attotime::from_hz(25000000), FUNC(scanline_timer_cb), -1); | |
43 | machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE); | |
44 | m_scanline_timer->adjust(machine().primary_screen->time_until_pos(scanline + 1), scanline); | |
45 | machine().scheduler().timer_set(attotime::from_hz(25000000), timer_expired_delegate(FUNC(midvunit_state::scanline_timer_cb),this), -1); | |
47 | 46 | } |
48 | 47 | else |
49 | machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE); | |
48 | machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE); | |
50 | 49 | } |
51 | 50 | |
52 | 51 | |
53 | 52 | void midvunit_state::video_start() |
54 | 53 | { |
55 | m_scanline_timer = machine().scheduler().timer_alloc(FUNC(scanline_timer_cb)); | |
54 | m_scanline_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(midvunit_state::scanline_timer_cb),this)); | |
56 | 55 | |
57 | 56 | m_poly = auto_alloc(machine(), midvunit_renderer(*this)); |
58 | 57 |
r18112 | r18113 | |
---|---|---|
82 | 82 | private: |
83 | 83 | void sio_interrupt( int n_port ); |
84 | 84 | void sio_timer_adjust( int n_port ); |
85 | | |
85 | TIMER_CALLBACK_MEMBER(sio_clock); | |
86 | 86 | |
87 | 87 | psx_sio port[2]; |
88 | 88 | }; |
r18112 | r18113 | |
---|---|---|
190 | 190 | dma_stop_timer( index ); |
191 | 191 | } |
192 | 192 | |
193 | ||
193 | TIMER_CALLBACK_MEMBER(psxdma_device::dma_finished_callback) | |
194 | 194 | { |
195 | 195 | dma_finished(param); |
196 | 196 | } |
r18112 | r18113 | |
---|---|---|
51 | 51 | void dma_timer_adjust( int n_channel ); |
52 | 52 | void dma_interrupt_update(); |
53 | 53 | void dma_finished( int n_channel ); |
54 | | |
54 | TIMER_CALLBACK_MEMBER(dma_finished_callback); | |
55 | 55 | void write( offs_t offset, UINT32 data, UINT32 mem_mask ); |
56 | 56 | UINT32 read( offs_t offset, UINT32 mem_mask ); |
57 | 57 |
r18112 | r18113 | |
---|---|---|
213 | 213 | } |
214 | 214 | } |
215 | 215 | |
216 | ||
216 | TIMER_CALLBACK_MEMBER(psxrcnt_device::root_finished) | |
217 | 217 | { |
218 | 218 | int n_counter = param; |
219 | 219 | psx_root *root = &root_counter[ n_counter ]; |
r18112 | r18113 | |
---|---|---|
53 | 53 | UINT16 root_current( int n_counter ); |
54 | 54 | int root_target( int n_counter ); |
55 | 55 | void root_timer_adjust( int n_counter ); |
56 | | |
56 | TIMER_CALLBACK_MEMBER(root_finished); | |
57 | 57 | }; |
58 | 58 | |
59 | 59 | #endif |
r18112 | r18113 | |
---|---|---|
157 | 157 | sio->timer->adjust( n_time, n_port); |
158 | 158 | } |
159 | 159 | |
160 | ||
160 | TIMER_CALLBACK_MEMBER(psxsio_device::sio_clock) | |
161 | 161 | { |
162 | 162 | int n_port = param; |
163 | 163 | psx_sio *sio = &port[ n_port ]; |
r18112 | r18113 | |
---|---|---|
63 | 63 | #define PERIOD_OF_555_ASTABLE(r1,r2,c) attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c)) |
64 | 64 | |
65 | 65 | #define TIMER_CALLBACK(name) void name(running_machine &machine, void *ptr, int param) |
66 | #define TIMER_CALLBACK_MEMBER(name) void name(void *ptr, INT32 param) | |
66 | 67 | |
67 | ||
68 | ||
69 | 68 | //************************************************************************** |
70 | 69 | // TYPE DEFINITIONS |
71 | 70 | //************************************************************************** |
Previous | 199869 Revisions | Next |