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

trunk/src/mame/drivers/lkage.c
r18112r18113
9595#define MCU_CLOCK         (XTAL_12MHz/4)
9696
9797
98static TIMER_CALLBACK( nmi_callback )
98TIMER_CALLBACK_MEMBER(lkage_state::nmi_callback)
9999{
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);
103102   else
104      state->m_pending_nmi = 1;
103      m_pending_nmi = 1;
105104}
106105
107106WRITE8_MEMBER(lkage_state::lkage_sound_command_w)
108107{
109108   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);
111110}
112111
113112WRITE8_MEMBER(lkage_state::lkage_sh_nmi_disable_w)
trunk/src/mame/drivers/snk.c
r18112r18113
343343
344344/*********************************************************************/
345345
346static TIMER_CALLBACK( sgladiat_sndirq_update_callback )
346TIMER_CALLBACK_MEMBER(snk_state::sgladiat_sndirq_update_callback)
347347{
348   snk_state *state = machine.driver_data<snk_state>();
349348
350349   switch(param)
351350   {
352351      case CMDIRQ_BUSY_ASSERT:
353         state->m_sound_status |= 8|4;
352         m_sound_status |= 8|4;
354353         break;
355354
356355      case BUSY_CLEAR:
357         state->m_sound_status &= ~4;
356         m_sound_status &= ~4;
358357         break;
359358
360359      case CMDIRQ_CLEAR:
361         state->m_sound_status &= ~8;
360         m_sound_status &= ~8;
362361         break;
363362   }
364363
365   machine.device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, (state->m_sound_status & 0x8) ? ASSERT_LINE : CLEAR_LINE);
364   machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, (m_sound_status & 0x8) ? ASSERT_LINE : CLEAR_LINE);
366365}
367366
368367
369368WRITE8_MEMBER(snk_state::sgladiat_soundlatch_w)
370369{
371370   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);
373372}
374373
375374READ8_MEMBER(snk_state::sgladiat_soundlatch_r)
376375{
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);
378377   return soundlatch_byte_r(space,0);
379378}
380379
381380READ8_MEMBER(snk_state::sgladiat_sound_nmi_ack_r)
382381{
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);
384383   return 0xff;
385384}
386385
r18112r18113
414413
415414*********************************************************************/
416415
417static TIMER_CALLBACK( sndirq_update_callback )
416TIMER_CALLBACK_MEMBER(snk_state::sndirq_update_callback)
418417{
419   snk_state *state = machine.driver_data<snk_state>();
420418
421419   switch(param)
422420   {
423421      case YM1IRQ_ASSERT:
424         state->m_sound_status |= 1;
422         m_sound_status |= 1;
425423         break;
426424
427425      case YM1IRQ_CLEAR:
428         state->m_sound_status &= ~1;
426         m_sound_status &= ~1;
429427         break;
430428
431429      case YM2IRQ_ASSERT:
432         state->m_sound_status |= 2;
430         m_sound_status |= 2;
433431         break;
434432
435433      case YM2IRQ_CLEAR:
436         state->m_sound_status &= ~2;
434         m_sound_status &= ~2;
437435         break;
438436
439437      case CMDIRQ_BUSY_ASSERT:
440         state->m_sound_status |= 8|4;
438         m_sound_status |= 8|4;
441439         break;
442440
443441      case BUSY_CLEAR:
444         state->m_sound_status &= ~4;
442         m_sound_status &= ~4;
445443         break;
446444
447445      case CMDIRQ_CLEAR:
448         state->m_sound_status &= ~8;
446         m_sound_status &= ~8;
449447         break;
450448   }
451449
452   machine.device("audiocpu")->execute().set_input_line(0, (state->m_sound_status & 0xb) ? ASSERT_LINE : CLEAR_LINE);
450   machine().device("audiocpu")->execute().set_input_line(0, (m_sound_status & 0xb) ? ASSERT_LINE : CLEAR_LINE);
453451}
454452
455453
456454
457455static WRITE_LINE_DEVICE_HANDLER( ymirq_callback_1 )
458456{
457   snk_state *drvstate = device->machine().driver_data<snk_state>();
459458   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);
461460}
462461
463462static WRITE_LINE_DEVICE_HANDLER( ymirq_callback_2 )
464463{
464   snk_state *drvstate = device->machine().driver_data<snk_state>();
465465   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);
467467}
468468
469469
r18112r18113
492492WRITE8_MEMBER(snk_state::snk_soundlatch_w)
493493{
494494   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);
496496}
497497
498498CUSTOM_INPUT_MEMBER(snk_state::snk_sound_busy)
r18112r18113
512512WRITE8_MEMBER(snk_state::snk_sound_status_w)
513513{
514514   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);
516516
517517   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);
519519
520520   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);
522522
523523   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);
525525}
526526
527527
528528
529529READ8_MEMBER(snk_state::tnk3_cmdirq_ack_r)
530530{
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);
532532   return 0xff;
533533}
534534
535535READ8_MEMBER(snk_state::tnk3_ymirq_ack_r)
536536{
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);
538538   return 0xff;
539539}
540540
r18112r18113
542542{
543543   // it's uncertain whether the latch should be cleared here or when it's read
544544   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);
546546   return 0xff;
547547}
548548
trunk/src/mame/drivers/40love.c
r18112r18113
231231#include "machine/buggychl.h"
232232#include "includes/40love.h"
233233
234static TIMER_CALLBACK( nmi_callback )
234TIMER_CALLBACK_MEMBER(fortyl_state::nmi_callback)
235235{
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);
239238   else
240      state->m_pending_nmi = 1;
239      m_pending_nmi = 1;
241240}
242241
243242WRITE8_MEMBER(fortyl_state::sound_command_w)
244243{
245244   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);
247246}
248247
249248WRITE8_MEMBER(fortyl_state::nmi_disable_w)
trunk/src/mame/drivers/galaga.c
r18112r18113
857857};
858858
859859
860static TIMER_CALLBACK( cpu3_interrupt_callback )
860TIMER_CALLBACK_MEMBER(galaga_state::cpu3_interrupt_callback)
861861{
862   galaga_state *state = machine.driver_data<galaga_state>();
863862   int scanline = param;
864863
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());
867866
868867   scanline = scanline + 128;
869868   if (scanline >= 272)
870869      scanline = 64;
871870
872871   /* the vertical synch chain is clocked by H256 -- this is probably not important, but oh well */
873   state->m_cpu3_interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
872   m_cpu3_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
874873}
875874
876875
r18112r18113
878877{
879878
880879   /* 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));
882881   m_custom_mod = 0;
883882   state_save_register_global(machine(), m_custom_mod);
884883   save_item(NAME(m_main_irq_mask));
trunk/src/mame/drivers/atarisy2.c
r18112r18113
284284}
285285
286286
287static TIMER_CALLBACK( delayed_int_enable_w )
287TIMER_CALLBACK_MEMBER(atarisy2_state::delayed_int_enable_w)
288288{
289   atarisy2_state *state = machine.driver_data<atarisy2_state>();
290   state->m_interrupt_enable = param;
289   m_interrupt_enable = param;
291290}
292291
293292
294293WRITE16_MEMBER(atarisy2_state::int_enable_w)
295294{
296295   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);
298297}
299298
300299
trunk/src/mame/drivers/midzeus.c
r18112r18113
6161
6262static emu_timer *timer[2];
6363
64static TIMER_CALLBACK( invasn_gun_callback );
6564
6665
6766
67
6868/*************************************
6969 *
7070 *  Machine init
r18112r18113
7676   timer[0] = machine().scheduler().timer_alloc(FUNC_NULL);
7777   timer[1] = machine().scheduler().timer_alloc(FUNC_NULL);
7878
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));
8181
8282   state_save_register_global(machine(), gun_control);
8383   state_save_register_global(machine(), gun_irq_state);
r18112r18113
106106 *
107107 *************************************/
108108
109static TIMER_CALLBACK( display_irq_off )
109TIMER_CALLBACK_MEMBER(midzeus_state::display_irq_off)
110110{
111   machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
111   machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
112112}
113113
114114INTERRUPT_GEN_MEMBER(midzeus_state::display_irq)
115115{
116116   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));
118118}
119119
120120
r18112r18113
489489}
490490
491491
492static TIMER_CALLBACK( invasn_gun_callback )
492TIMER_CALLBACK_MEMBER(midzeus_state::invasn_gun_callback)
493493{
494494   int player = param;
495   int beamy = machine.primary_screen->vpos();
495   int beamy = machine().primary_screen->vpos();
496496
497497   /* set the appropriate IRQ in the internal gun control and update */
498498   gun_irq_state |= 0x01 << player;
499   update_gun_irq(machine);
499   update_gun_irq(machine());
500500
501501   /* generate another interrupt on the next scanline while we are within the BEAM_DY */
502502   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);
505505}
506506
507507
trunk/src/mame/drivers/slapshot.c
r18112r18113
171171                INTERRUPTS
172172***********************************************************/
173173
174static TIMER_CALLBACK( slapshot_interrupt6 )
174TIMER_CALLBACK_MEMBER(slapshot_state::slapshot_interrupt6)
175175{
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);
178177}
179178
180179
181180INTERRUPT_GEN_MEMBER(slapshot_state::slapshot_interrupt)
182181{
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));
184183   device.execute().set_input_line(5, HOLD_LINE);
185184}
186185
trunk/src/mame/drivers/wgp.c
r18112r18113
444444/* 68000 A */
445445
446446#ifdef UNUSED_FUNCTION
447static TIMER_CALLBACK( wgp_interrupt4 )
447TIMER_CALLBACK_MEMBER(wgp_state::wgp_interrupt4)
448448{
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);
451450}
452451#endif
453452
454static TIMER_CALLBACK( wgp_interrupt6 )
453TIMER_CALLBACK_MEMBER(wgp_state::wgp_interrupt6)
455454{
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);
458456}
459457
460458/* 68000 B */
461459
462static TIMER_CALLBACK( wgp_cpub_interrupt6 )
460TIMER_CALLBACK_MEMBER(wgp_state::wgp_cpub_interrupt6)
463461{
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 */
466463}
467464
468465
r18112r18113
474471
475472INTERRUPT_GEN_MEMBER(wgp_state::wgp_cpub_interrupt)
476473{
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));
478475   device.execute().set_input_line(4, HOLD_LINE);
479476}
480477
r18112r18113
597594       hardware has got the next a/d conversion ready. We set a token
598595       delay of 10000 cycles although our inputs are always ready. */
599596
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));
601598}
602599
603600
trunk/src/mame/drivers/exidy440.c
r18112r18113
354354 *
355355 *************************************/
356356
357static TIMER_CALLBACK( delayed_sound_command_w )
357TIMER_CALLBACK_MEMBER(exidy440_state::delayed_sound_command_w)
358358{
359   exidy440_state *state = machine.driver_data<exidy440_state>();
360   exidy440_sound_command(state->m_custom, param);
359   exidy440_sound_command(m_custom, param);
361360}
362361
363362
364363WRITE8_MEMBER(exidy440_state::sound_command_w)
365364{
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);
367366}
368367
369368
trunk/src/mame/drivers/taito_b.c
r18112r18113
196196   membank("bank1")->set_entry((data - 1) & 3);
197197}
198198
199static TIMER_CALLBACK( rsaga2_interrupt2 )
199TIMER_CALLBACK_MEMBER(taitob_state::rsaga2_interrupt2)
200200{
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);
203202}
204203
205204INTERRUPT_GEN_MEMBER(taitob_state::rastansaga2_interrupt)
206205{
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));
208207   device.execute().set_input_line(4, HOLD_LINE);
209208}
210209
211210
212static TIMER_CALLBACK( crimec_interrupt3 )
211TIMER_CALLBACK_MEMBER(taitob_state::crimec_interrupt3)
213212{
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);
216214}
217215
218216INTERRUPT_GEN_MEMBER(taitob_state::crimec_interrupt)
219217{
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));
221219   device.execute().set_input_line(5, HOLD_LINE);
222220}
223221
224222
225static TIMER_CALLBACK( hitice_interrupt6 )
223TIMER_CALLBACK_MEMBER(taitob_state::hitice_interrupt6)
226224{
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);
229226}
230227
231228INTERRUPT_GEN_MEMBER(taitob_state::hitice_interrupt)
232229{
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));
234231   device.execute().set_input_line(4, HOLD_LINE);
235232}
236233
237234
238static TIMER_CALLBACK( rambo3_interrupt1 )
235TIMER_CALLBACK_MEMBER(taitob_state::rambo3_interrupt1)
239236{
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);
242238}
243239
244240INTERRUPT_GEN_MEMBER(taitob_state::rambo3_interrupt)
245241{
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));
247243   device.execute().set_input_line(6, HOLD_LINE);
248244}
249245
250246
251static TIMER_CALLBACK( pbobble_interrupt5 )
247TIMER_CALLBACK_MEMBER(taitob_state::pbobble_interrupt5)
252248{
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);
255250}
256251
257252INTERRUPT_GEN_MEMBER(taitob_state::pbobble_interrupt)
258253{
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));
260255   device.execute().set_input_line(3, HOLD_LINE);
261256}
262257
263static TIMER_CALLBACK( viofight_interrupt1 )
258TIMER_CALLBACK_MEMBER(taitob_state::viofight_interrupt1)
264259{
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);
267261}
268262
269263INTERRUPT_GEN_MEMBER(taitob_state::viofight_interrupt)
270264{
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));
272266   device.execute().set_input_line(4, HOLD_LINE);
273267}
274268
275static TIMER_CALLBACK( masterw_interrupt4 )
269TIMER_CALLBACK_MEMBER(taitob_state::masterw_interrupt4)
276270{
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);
279272}
280273
281274INTERRUPT_GEN_MEMBER(taitob_state::masterw_interrupt)
282275{
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));
284277   device.execute().set_input_line(5, HOLD_LINE);
285278}
286279
287static TIMER_CALLBACK( silentd_interrupt4 )
280TIMER_CALLBACK_MEMBER(taitob_state::silentd_interrupt4)
288281{
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);
291283}
292284
293285INTERRUPT_GEN_MEMBER(taitob_state::silentd_interrupt)
294286{
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));
296288   device.execute().set_input_line(6, HOLD_LINE);
297289}
298290
299static TIMER_CALLBACK( selfeena_interrupt4 )
291TIMER_CALLBACK_MEMBER(taitob_state::selfeena_interrupt4)
300292{
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);
303294}
304295
305296INTERRUPT_GEN_MEMBER(taitob_state::selfeena_interrupt)
306297{
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));
308299   device.execute().set_input_line(6, HOLD_LINE);
309300}
310301
311static TIMER_CALLBACK( sbm_interrupt5 )//4
302TIMER_CALLBACK_MEMBER(taitob_state::sbm_interrupt5)//4
312303{
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);
315305}
316306
317307INTERRUPT_GEN_MEMBER(taitob_state::sbm_interrupt)//5
318308{
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));
320310   device.execute().set_input_line(4, HOLD_LINE);
321311}
322312
323static TIMER_CALLBACK( realpunc_interrupt3 )//3
313TIMER_CALLBACK_MEMBER(taitob_state::realpunc_interrupt3)//3
324314{
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);
327316}
328317
329318INTERRUPT_GEN_MEMBER(taitob_state::realpunc_interrupt)//2
330319{
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));
332321   device.execute().set_input_line(2, HOLD_LINE);
333322}
334323
trunk/src/mame/drivers/xexex.c
r18112r18113
255255   flt_volume_set_volume(state->m_filter2r, (71.0 * right) / 55.0);
256256}
257257
258static TIMER_CALLBACK( dmaend_callback )
258TIMER_CALLBACK_MEMBER(xexex_state::dmaend_callback)
259259{
260   xexex_state *state = machine.driver_data<xexex_state>();
261260
262   if (state->m_cur_control2 & 0x0040)
261   if (m_cur_control2 & 0x0040)
263262   {
264263      // foul-proof (CPU0 could be deactivated while we wait)
265      if (state->m_suspension_active)
264      if (m_suspension_active)
266265      {
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);
269268      }
270269
271270      // IRQ 5 is the "object DMA end interrupt" and shouldn't be triggered
272271      // if object data isn't ready for DMA within the frame.
273      state->m_maincpu->set_input_line(5, HOLD_LINE);
272      m_maincpu->set_input_line(5, HOLD_LINE);
274273   }
275274}
276275
r18112r18113
486485   save_item(NAME(m_cur_sound_region));
487486   machine().save().register_postload(save_prepost_delegate(FUNC(xexex_postload), &machine()));
488487
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));
490489}
491490
492491void xexex_state::machine_reset()
trunk/src/mame/drivers/topspeed.c
r18112r18113
322322
323323/* 68000 A */
324324
325static TIMER_CALLBACK( topspeed_interrupt6  )
325TIMER_CALLBACK_MEMBER(topspeed_state::topspeed_interrupt6)
326326{
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);
329328}
330329
331330/* 68000 B */
332331
333static TIMER_CALLBACK( topspeed_cpub_interrupt6 )
332TIMER_CALLBACK_MEMBER(topspeed_state::topspeed_cpub_interrupt6)
334333{
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 */
337335}
338336
339337
340338INTERRUPT_GEN_MEMBER(topspeed_state::topspeed_interrupt)
341339{
342340   /* 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));
344342   device.execute().set_input_line(5, HOLD_LINE);
345343}
346344
347345INTERRUPT_GEN_MEMBER(topspeed_state::topspeed_cpub_interrupt)
348346{
349347   /* 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));
351349   device.execute().set_input_line(5, HOLD_LINE);
352350}
353351
trunk/src/mame/drivers/thunderx.c
r18112r18113
2828      device.execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
2929}
3030
31static TIMER_CALLBACK( thunderx_firq_callback )
31TIMER_CALLBACK_MEMBER(thunderx_state::thunderx_firq_callback)
3232{
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);
3534}
3635
3736READ8_MEMBER(thunderx_state::scontra_bankedram_r)
r18112r18113
306305      calculate_collisions(machine());
307306
308307      /* 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));
310309   }
311310
312311   m_1f98_data = data;
trunk/src/mame/drivers/videopin.c
r18112r18113
4444}
4545
4646
47static TIMER_CALLBACK( interrupt_callback )
47TIMER_CALLBACK_MEMBER(videopin_state::interrupt_callback)
4848{
4949   int scanline = param;
5050
51   update_plunger(machine);
51   update_plunger(machine());
5252
53   machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
53   machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
5454
5555   scanline = scanline + 32;
5656
5757   if (scanline >= 263)
5858      scanline = 32;
5959
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);
6161}
6262
6363
6464void videopin_state::machine_reset()
6565{
6666
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);
6868
6969   /* both output latches are cleared on reset */
7070
trunk/src/mame/drivers/ultratnk.c
r18112r18113
4141}
4242
4343
44static TIMER_CALLBACK( nmi_callback   )
44TIMER_CALLBACK_MEMBER(ultratnk_state::nmi_callback)
4545{
4646   int scanline = param + 64;
4747
r18112r18113
5050
5151   /* NMI and watchdog are disabled during service mode */
5252
53   machine.watchdog_enable(machine.root_device().ioport("IN0")->read() & 0x40);
53   machine().watchdog_enable(machine().root_device().ioport("IN0")->read() & 0x40);
5454
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);
5757
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);
5959}
6060
6161
6262void ultratnk_state::machine_reset()
6363{
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);
6565}
6666
6767
trunk/src/mame/drivers/superqix.c
r18112r18113
182182   return m_from_mcu;
183183}
184184
185static TIMER_CALLBACK( mcu_acknowledge_callback )
185TIMER_CALLBACK_MEMBER(superqix_state::mcu_acknowledge_callback)
186186{
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);
191190}
192191
193192READ8_MEMBER(superqix_state::mcu_acknowledge_r)
194193{
195   machine().scheduler().synchronize(FUNC(mcu_acknowledge_callback));
194   machine().scheduler().synchronize(timer_expired_delegate(FUNC(superqix_state::mcu_acknowledge_callback),this));
196195   return 0;
197196}
198197
r18112r18113
364363
365364
366365
367static TIMER_CALLBACK( delayed_z80_mcu_w )
366TIMER_CALLBACK_MEMBER(superqix_state::delayed_z80_mcu_w)
368367{
369   superqix_state *state = machine.driver_data<superqix_state>();
370368//  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));
375373}
376374
377static TIMER_CALLBACK( delayed_mcu_z80_w )
375TIMER_CALLBACK_MEMBER(superqix_state::delayed_mcu_z80_w)
378376{
379   superqix_state *state = machine.driver_data<superqix_state>();
380377//  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;
383380}
384381
385382
r18112r18113
445442            break;
446443
447444         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);
449446            break;
450447
451448         case 0x6:
r18112r18113
461458
462459WRITE8_MEMBER(superqix_state::hotsmash_z80_mcu_w)
463460{
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);
465462}
466463
467464READ8_MEMBER(superqix_state::hotsmash_from_mcu_r)
trunk/src/mame/drivers/rltennis.c
r18112r18113
130130   PORT_BIT( 0xff80, IP_ACTIVE_LOW, IPT_UNUSED )
131131INPUT_PORTS_END
132132
133static TIMER_CALLBACK( sample_player )
133TIMER_CALLBACK_MEMBER(rltennis_state::sample_player)
134134{
135   rltennis_state *state = machine.driver_data<rltennis_state>();
136135
137   if((state->m_dac_counter&0x7ff) == 0x7ff) /* reload top address bits */
136   if((m_dac_counter&0x7ff) == 0x7ff) /* reload top address bits */
138137   {
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 */
142141   }
143   ++state->m_dac_counter; /* update low address bits */
142   ++m_dac_counter; /* update low address bits */
144143
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 ));
148147}
149148
150149INTERRUPT_GEN_MEMBER(rltennis_state::rltennis_interrupt)
r18112r18113
163162   m_samples_1 = memregion("samples1")->base();
164163   m_samples_2 = memregion("samples2")->base();
165164   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));
167166}
168167
169168void rltennis_state::machine_reset()
trunk/src/mame/drivers/capbowl.c
r18112r18113
119119 *
120120 *************************************/
121121
122static TIMER_CALLBACK( capbowl_update )
122TIMER_CALLBACK_MEMBER(capbowl_state::capbowl_update)
123123{
124124   int scanline = param;
125125
126   machine.primary_screen->update_partial(scanline - 1);
126   machine().primary_screen->update_partial(scanline - 1);
127127   scanline += 32;
128128   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);
130130}
131131
132132
r18112r18113
348348void capbowl_state::machine_reset()
349349{
350350
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);
352352
353353   m_blitter_addr = 0;
354354   m_last_trackball_val[0] = 0;
trunk/src/mame/drivers/fromance.c
r18112r18113
5959}
6060
6161
62static TIMER_CALLBACK( deferred_commanddata_w )
62TIMER_CALLBACK_MEMBER(fromance_state::deferred_commanddata_w)
6363{
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;
6766}
6867
6968
7069WRITE8_MEMBER(fromance_state::fromance_commanddata_w)
7170{
7271   /* 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);
7473}
7574
7675
trunk/src/mame/drivers/mustache.c
r18112r18113
157157   GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x80, 8 )
158158GFXDECODE_END
159159
160static TIMER_CALLBACK( clear_irq_cb )
160TIMER_CALLBACK_MEMBER(mustache_state::clear_irq_cb)
161161{
162   machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
162   machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
163163}
164164
165165INTERRUPT_GEN_MEMBER(mustache_state::assert_irq)
r18112r18113
179179
180180void mustache_state::machine_start()
181181{
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));
183183}
184184
185185static MACHINE_CONFIG_START( mustache, mustache_state )
trunk/src/mame/drivers/turbo.c
r18112r18113
564564}
565565
566566
567static TIMER_CALLBACK( delayed_i8255_w )
567TIMER_CALLBACK_MEMBER(turbo_state::delayed_i8255_w)
568568{
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);
571570}
572571
573572
r18112r18113
575574{
576575   /* the port C handshaking signals control the sub CPU IRQ, */
577576   /* 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));
579578}
580579
581580
trunk/src/mame/drivers/buggychl.c
r18112r18113
9191   membank("bank1")->set_entry(data & 0x07);   // shall we check if data&7 < # banks?
9292}
9393
94static TIMER_CALLBACK( nmi_callback )
94TIMER_CALLBACK_MEMBER(buggychl_state::nmi_callback)
9595{
96   buggychl_state *state = machine.driver_data<buggychl_state>();
9796
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);
10099   else
101      state->m_pending_nmi = 1;
100      m_pending_nmi = 1;
102101}
103102
104103WRITE8_MEMBER(buggychl_state::sound_command_w)
105104{
106105   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);
108107}
109108
110109WRITE8_MEMBER(buggychl_state::nmi_disable_w)
trunk/src/mame/drivers/taito_f2.c
r18112r18113
572572
573573******************************************************************/
574574
575static TIMER_CALLBACK( taitof2_interrupt6 )
575TIMER_CALLBACK_MEMBER(taitof2_state::taitof2_interrupt6)
576576{
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);
579578}
580579
581580INTERRUPT_GEN_MEMBER(taitof2_state::taitof2_interrupt)
582581{
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));
584583   device.execute().set_input_line(5, HOLD_LINE);
585584}
586585
trunk/src/mame/drivers/gottlieb.c
r18112r18113
220220 *
221221 *************************************/
222222
223static TIMER_CALLBACK( laserdisc_bit_callback );
224static TIMER_CALLBACK( laserdisc_philips_callback );
225223
226224
227225
228226
229227
230228
229
230
231231/*************************************
232232 *
233233 *  Initialization
r18112r18113
249249      machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x05806, 0x05806, 0, 0x07f8, write8_delegate(FUNC(gottlieb_state::laserdisc_select_w),this));
250250
251251      /* 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));
254254
255255      /* create some audio RAM */
256256      m_laserdisc_audio_buffer = auto_alloc_array(machine(), UINT8, AUDIORAM_SIZE);
r18112r18113
420420 *
421421 *************************************/
422422
423static TIMER_CALLBACK( laserdisc_philips_callback )
423TIMER_CALLBACK_MEMBER(gottlieb_state::laserdisc_philips_callback)
424424{
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);
427426
428427   /* the PR8210 sends line 17/18 data on each frame; the laserdisc interface
429428       board receives notification and latches the most recent frame number */
r18112r18113
431430   /* the logic detects a valid code when the top 4 bits are all 1s */
432431   if ((newcode & 0xf00000) == 0xf00000)
433432   {
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);
436435   }
437436
438437   /* toggle to the next one */
439438   param = (param == 17) ? 18 : 17;
440   state->m_laserdisc_philips_timer->adjust(machine.primary_screen->time_until_pos(param * 2), param);
439   m_laserdisc_philips_timer->adjust(machine().primary_screen->time_until_pos(param * 2), param);
441440}
442441
443442
444static TIMER_CALLBACK( laserdisc_bit_off_callback )
443TIMER_CALLBACK_MEMBER(gottlieb_state::laserdisc_bit_off_callback)
445444{
446   gottlieb_state *state = machine.driver_data<gottlieb_state>();
447445   /* deassert the control line */
448   state->m_laserdisc->control_w(CLEAR_LINE);
446   m_laserdisc->control_w(CLEAR_LINE);
449447}
450448
451449
452static TIMER_CALLBACK( laserdisc_bit_callback )
450TIMER_CALLBACK_MEMBER(gottlieb_state::laserdisc_bit_callback)
453451{
454   gottlieb_state *state = machine.driver_data<gottlieb_state>();
455452   UINT8 bitsleft = param >> 16;
456453   UINT8 data = param;
457454   attotime duration;
458455
459456   /* 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));
462459
463460   /* determine how long for the next command; there is a 555 timer with a
464461       variable resistor controlling the timing of the pulses. Nominally, the
r18112r18113
470467
471468   /* if we're not out of bits, set a timer for the next one; else set the ready bit */
472469   if (bitsleft-- != 0)
473      state->m_laserdisc_bit_timer->adjust(duration, (bitsleft << 16) | data);
470      m_laserdisc_bit_timer->adjust(duration, (bitsleft << 16) | data);
474471   else
475      state->m_laserdisc_status |= 0x10;
472      m_laserdisc_status |= 0x10;
476473}
477474
478475
r18112r18113
651648 *
652649 *************************************/
653650
654static TIMER_CALLBACK( nmi_clear )
651TIMER_CALLBACK_MEMBER(gottlieb_state::nmi_clear)
655652{
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);
657654}
658655
659656
r18112r18113
661658{
662659   /* assert the NMI and set a timer to clear it at the first visible line */
663660   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));
665662
666663   /* if we have a laserdisc, update it */
667664   if (m_laserdisc != NULL)
trunk/src/mame/drivers/vicdual.c
r18112r18113
6767#define COIN_PORT_TAG      "COIN"
6868
6969
70static TIMER_CALLBACK( clear_coin_status )
70TIMER_CALLBACK_MEMBER(vicdual_state::clear_coin_status)
7171{
72   vicdual_state *state = machine.driver_data<vicdual_state>();
73   state->m_coin_status = 0;
72   m_coin_status = 0;
7473}
7574
7675
r18112r18113
9897      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
9998
10099      /* 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));
102101   }
103102}
104103
trunk/src/mame/drivers/groundfx.c
r18112r18113
9898                INTERRUPTS
9999***********************************************************/
100100
101static TIMER_CALLBACK( groundfx_interrupt5 )
101TIMER_CALLBACK_MEMBER(groundfx_state::groundfx_interrupt5)
102102{
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
104104}
105105
106106
r18112r18113
173173{
174174   /* One interrupt per input port (4 per frame, though only 2 used).
175175        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));
177177}
178178
179179WRITE32_MEMBER(groundfx_state::rotate_control_w)/* only a guess that it's rotation */
trunk/src/mame/drivers/m72.c
r18112r18113
9797
9898
9999
100static TIMER_CALLBACK( m72_scanline_interrupt );
101static TIMER_CALLBACK( kengo_scanline_interrupt );
102100
101
102
103103/***************************************************************************/
104104
105105MACHINE_START_MEMBER(m72_state,m72)
106106{
107107   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));
109109
110110   save_item(NAME(m_mcu_sample_addr));
111111   save_item(NAME(m_mcu_snd_cmd_latch));
r18112r18113
113113
114114MACHINE_START_MEMBER(m72_state,kengo)
115115{
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));
117117
118118   save_item(NAME(m_mcu_sample_addr));
119119   save_item(NAME(m_mcu_snd_cmd_latch));
120120}
121121
122static TIMER_CALLBACK( synch_callback )
122TIMER_CALLBACK_MEMBER(m72_state::synch_callback)
123123{
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));
126126}
127127
128128MACHINE_RESET_MEMBER(m72_state,m72)
r18112r18113
132132   m_mcu_snd_cmd_latch = 0;
133133
134134   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));
136136}
137137
138138MACHINE_RESET_MEMBER(m72_state,xmultipl)
r18112r18113
146146   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(0));
147147}
148148
149static TIMER_CALLBACK( m72_scanline_interrupt )
149TIMER_CALLBACK_MEMBER(m72_state::m72_scanline_interrupt)
150150{
151   m72_state *state = machine.driver_data<m72_state>();
152151   int scanline = param;
153152
154153   /* raster interrupt - visible area only? */
155   if (scanline < 256 && scanline == state->m_raster_irq_position - 128)
154   if (scanline < 256 && scanline == m_raster_irq_position - 128)
156155   {
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);
159158   }
160159
161160   /* VBLANK interrupt */
162161   else if (scanline == 256)
163162   {
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);
166165   }
167166
168167   /* adjust for next scanline */
169   if (++scanline >= machine.primary_screen->height())
168   if (++scanline >= machine().primary_screen->height())
170169      scanline = 0;
171   state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
170   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
172171}
173172
174static TIMER_CALLBACK( kengo_scanline_interrupt )
173TIMER_CALLBACK_MEMBER(m72_state::kengo_scanline_interrupt)
175174{
176   m72_state *state = machine.driver_data<m72_state>();
177175   int scanline = param;
178176
179177   /* raster interrupt - visible area only? */
180   if (scanline < 256 && scanline == state->m_raster_irq_position - 128)
178   if (scanline < 256 && scanline == m_raster_irq_position - 128)
181179   {
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);
184182   }
185183   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);
187185
188186   /* VBLANK interrupt */
189187   if (scanline == 256)
190188   {
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);
193191   }
194192   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);
196194
197195   /* adjust for next scanline */
198   if (++scanline >= machine.primary_screen->height())
196   if (++scanline >= machine().primary_screen->height())
199197      scanline = 0;
200   state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
198   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
201199}
202200
203201/***************************************************************************
r18112r18113
215213
216214***************************************************************************/
217215
218static TIMER_CALLBACK( delayed_ram16_w )
216TIMER_CALLBACK_MEMBER(m72_state::delayed_ram16_w)
219217{
220218   UINT16 val = ((UINT32) param) & 0xffff;
221219   UINT16 offset = (((UINT32) param) >> 16) & 0xffff;
r18112r18113
256254      //machine().scheduler().timer_set(machine().device<cpu_device>("mcu")->cycles_to_attotime(0), FUNC(mcu_irq0_raise));
257255   }
258256   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);
260258}
261259
262260WRITE8_MEMBER(m72_state::m72_mcu_data_w)
r18112r18113
265263   if (offset&1) val = (m_protection_ram[offset/2] & 0x00ff) | (data << 8);
266264   else val = (m_protection_ram[offset/2] & 0xff00) | (data&0xff);
267265
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);
269267}
270268
271269READ8_MEMBER(m72_state::m72_mcu_data_r)
trunk/src/mame/drivers/fuukifg2.c
r18112r18113
414414            also used for water effects and titlescreen linescroll on gogomile
415415*/
416416
417static TIMER_CALLBACK( level_1_interrupt_callback )
417TIMER_CALLBACK_MEMBER(fuuki16_state::level_1_interrupt_callback)
418418{
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));
422421}
423422
424423
425static TIMER_CALLBACK( vblank_interrupt_callback )
424TIMER_CALLBACK_MEMBER(fuuki16_state::vblank_interrupt_callback)
426425{
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));
430428}
431429
432430
433static TIMER_CALLBACK( raster_interrupt_callback )
431TIMER_CALLBACK_MEMBER(fuuki16_state::raster_interrupt_callback)
434432{
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());
439436}
440437
441438
r18112r18113
448445   m_maincpu = machine().device<cpu_device>("maincpu");
449446   m_audiocpu = machine().device<cpu_device>("audiocpu");
450447
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));
452449}
453450
454451
r18112r18113
456453{
457454   const rectangle &visarea = machine().primary_screen->visible_area();
458455
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));
461458   m_raster_interrupt_timer->adjust(machine().primary_screen->time_until_pos(0, visarea.max_x + 1));
462459}
463460
trunk/src/mame/drivers/spacefb.c
r18112r18113
124124 *************************************/
125125
126126
127static TIMER_CALLBACK( interrupt_callback )
127TIMER_CALLBACK_MEMBER(spacefb_state::interrupt_callback)
128128{
129   spacefb_state *state = machine.driver_data<spacefb_state>();
130129   int next_vpos;
131130
132131   /* compute vector and set the interrupt line */
133   int vpos = machine.primary_screen->vpos();
132   int vpos = machine().primary_screen->vpos();
134133   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);
136135
137136   /* set up for next interrupt */
138137   if (vpos == SPACEFB_INT_TRIGGER_COUNT_1)
r18112r18113
140139   else
141140      next_vpos = SPACEFB_INT_TRIGGER_COUNT_1;
142141
143   state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(next_vpos));
142   m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(next_vpos));
144143}
145144
146145
147146static void create_interrupt_timer(running_machine &machine)
148147{
149148   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));
151150}
152151
153152
trunk/src/mame/drivers/gaplus.c
r18112r18113
234234   machine().device("sub")->execute().set_input_line(0, CLEAR_LINE);
235235}
236236
237static TIMER_CALLBACK( namcoio_run )
237TIMER_CALLBACK_MEMBER(gaplus_state::namcoio_run)
238238{
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");
241241
242242   switch (param)
243243   {
r18112r18113
260260      machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
261261
262262   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));
264264
265265   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);
267267}
268268
269269INTERRUPT_GEN_MEMBER(gaplus_state::gaplus_vblank_sub_irq)
trunk/src/mame/drivers/gridlee.c
r18112r18113
9797 *
9898 *************************************/
9999
100static TIMER_CALLBACK( irq_off_tick )
100TIMER_CALLBACK_MEMBER(gridlee_state::irq_off_tick)
101101{
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);
103103}
104104
105105
106static TIMER_CALLBACK( irq_timer_tick )
106TIMER_CALLBACK_MEMBER(gridlee_state::irq_timer_tick)
107107{
108   gridlee_state *state = machine.driver_data<gridlee_state>();
109108   /* next interrupt after scanline 256 is scanline 64 */
110109   if (param == 256)
111      state->m_irq_timer->adjust(machine.primary_screen->time_until_pos(64), 64);
110      m_irq_timer->adjust(machine().primary_screen->time_until_pos(64), 64);
112111   else
113      state->m_irq_timer->adjust(machine.primary_screen->time_until_pos(param + 64), param + 64);
112      m_irq_timer->adjust(machine().primary_screen->time_until_pos(param + 64), param + 64);
114113
115114   /* 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);
117116
118117   /* it will turn off on the next HBLANK */
119   state->m_irq_off->adjust(machine.primary_screen->time_until_pos(param, GRIDLEE_HBSTART));
118   m_irq_off->adjust(machine().primary_screen->time_until_pos(param, GRIDLEE_HBSTART));
120119}
121120
122121
123static TIMER_CALLBACK( firq_off_tick )
122TIMER_CALLBACK_MEMBER(gridlee_state::firq_off_tick)
124123{
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);
126125}
127126
128127
129static TIMER_CALLBACK( firq_timer_tick )
128TIMER_CALLBACK_MEMBER(gridlee_state::firq_timer_tick)
130129{
131   gridlee_state *state = machine.driver_data<gridlee_state>();
132130   /* same time next frame */
133   state->m_firq_timer->adjust(machine.primary_screen->time_until_pos(FIRQ_SCANLINE));
131   m_firq_timer->adjust(machine().primary_screen->time_until_pos(FIRQ_SCANLINE));
134132
135133   /* 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);
137135
138136   /* it will turn off on the next HBLANK */
139   state->m_firq_off->adjust(machine.primary_screen->time_until_pos(FIRQ_SCANLINE, GRIDLEE_HBSTART));
137   m_firq_off->adjust(machine().primary_screen->time_until_pos(FIRQ_SCANLINE, GRIDLEE_HBSTART));
140138}
141139
142140void gridlee_state::machine_start()
r18112r18113
149147   state_save_register_global_array(machine(), m_last_analog_input);
150148   state_save_register_global_array(machine(), m_last_analog_output);
151149
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));
156154}
157155
158156
trunk/src/mame/drivers/artmagic.c
r18112r18113
133133 *
134134 *************************************/
135135
136static TIMER_CALLBACK( irq_off )
136TIMER_CALLBACK_MEMBER(artmagic_state::irq_off)
137137{
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());
141140}
142141
143142READ16_MEMBER(artmagic_state::ultennis_hack_r)
r18112r18113
148147   {
149148      m_hack_irq = 1;
150149      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));
152151   }
153152   return ioport("300000")->read();
154153}
trunk/src/mame/drivers/moo.c
r18112r18113
118118   if (num_inactive) do { *dst = 0; dst += 8; } while (--num_inactive);
119119}
120120
121static TIMER_CALLBACK( dmaend_callback )
121TIMER_CALLBACK_MEMBER(moo_state::dmaend_callback)
122122{
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);
126125}
127126
128127INTERRUPT_GEN_MEMBER(moo_state::moo_interrupt)
r18112r18113
439438   save_item(NAME(m_layerpri));
440439   save_item(NAME(m_protram));
441440
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));
443442}
444443
445444MACHINE_RESET_MEMBER(moo_state,moo)
trunk/src/mame/drivers/tmnt.c
r18112r18113
315315}
316316#endif
317317
318static TIMER_CALLBACK( nmi_callback )
318TIMER_CALLBACK_MEMBER(tmnt_state::nmi_callback)
319319{
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);
322321}
323322
324323WRITE8_MEMBER(tmnt_state::sound_arm_nmi_w)
325324{
326325//  sound_nmi_enabled = 1;
327326   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 */
329328}
330329
331330
trunk/src/mame/drivers/coolpool.c
r18112r18113
454454 *
455455 *************************************/
456456
457static TIMER_CALLBACK( deferred_iop_w )
457TIMER_CALLBACK_MEMBER(coolpool_state::deferred_iop_w)
458458{
459   coolpool_state *state = machine.driver_data<coolpool_state>();
460459
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! */
464463                                             /* the DSP polls the status bit so it isn't strictly */
465464                                             /* 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));
467466}
468467
469468
470469WRITE16_MEMBER(coolpool_state::coolpool_iop_w)
471470{
472471   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);
474473}
475474
476475
trunk/src/mame/drivers/mappy.c
r18112r18113
747747
748748/* different games need different interrupt generators & timers because they use different Namco I/O devices */
749749
750static TIMER_CALLBACK( superpac_io_run )
750TIMER_CALLBACK_MEMBER(mappy_state::superpac_io_run)
751751{
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");
754754
755755   switch (param)
756756   {
r18112r18113
772772      machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
773773
774774   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));
776776
777777   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);
779779}
780780
781static TIMER_CALLBACK( pacnpal_io_run )
781TIMER_CALLBACK_MEMBER(mappy_state::pacnpal_io_run)
782782{
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");
785785
786786   switch (param)
787787   {
r18112r18113
803803      machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
804804
805805   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));
807807
808808   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);
810810}
811811
812static TIMER_CALLBACK( phozon_io_run )
812TIMER_CALLBACK_MEMBER(mappy_state::phozon_io_run)
813813{
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");
816816
817817   switch (param)
818818   {
r18112r18113
834834      machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
835835
836836   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));
838838
839839   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);
841841}
842842
843static TIMER_CALLBACK( mappy_io_run )
843TIMER_CALLBACK_MEMBER(mappy_state::mappy_io_run)
844844{
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");
847847
848848   switch (param)
849849   {
r18112r18113
865865      machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
866866
867867   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));
869869
870870   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);
872872}
873873
874874INTERRUPT_GEN_MEMBER(mappy_state::sub_vblank_irq)
trunk/src/mame/drivers/undrfire.c
r18112r18113
225225                INTERRUPTS
226226***********************************************************/
227227
228static TIMER_CALLBACK( interrupt5 )
228TIMER_CALLBACK_MEMBER(undrfire_state::interrupt5)
229229{
230   machine.device("maincpu")->execute().set_input_line(5, HOLD_LINE);
230   machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
231231}
232232
233233
r18112r18113
359359WRITE32_MEMBER(undrfire_state::unknown_int_req_w)
360360{
361361   /* 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));
363363}
364364
365365
r18112r18113
464464{
465465   /* One interrupt per input port (4 per frame, though only 2 used).
466466        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));
468468}
469469
470470/***********************************************************
trunk/src/mame/drivers/tubep.c
r18112r18113
254254ADDRESS_MAP_END
255255
256256
257static TIMER_CALLBACK( tubep_scanline_callback )
257TIMER_CALLBACK_MEMBER(tubep_state::tubep_scanline_callback)
258258{
259   tubep_state *state = machine.driver_data<tubep_state>();
260259   int scanline = param;
261260
262   state->m_curr_scanline = scanline;//for debugging
261   m_curr_scanline = scanline;//for debugging
263262
264263   /* CPU #0 interrupt */
265264   /* activates at the start of VBLANK signal which happens at the beginning of scaline number 240 */
266265   if (scanline == 240)
267266   {
268267      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);
270269   }
271270
272271
r18112r18113
275274   if (scanline == 16)
276275   {
277276      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);
279278   }
280279
281280
r18112r18113
284283   if (scanline == 16)
285284   {
286285      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);
289288   }
290289   /* CPU #3 MS2010-A NMI */
291290   /* deactivates at the start of VBLANK signal which happens at the beginning of scanline number 240*/
292291   if (scanline == 240)
293292   {
294293      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);
296295   }
297296
298297
r18112r18113
300299   /* activates whenever line V6 from video part goes lo->hi that is when the scanline becomes 64 and 192 */
301300   if ((scanline == 64) || (scanline == 192))
302301   {
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) */
304303   }
305304
306305
307   machine.primary_screen->update_partial(machine.primary_screen->vpos());
306   machine().primary_screen->update_partial(machine().primary_screen->vpos());
308307
309308   //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());
311310
312311   scanline++;
313312   if (scanline >= 264)
314313      scanline = 0;
315314
316   state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
315   m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
317316}
318317
319318
r18112r18113
338337MACHINE_START_MEMBER(tubep_state,tubep)
339338{
340339   /* 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));
342341
343342   tubep_setup_save_state(machine());
344343}
r18112r18113
437436ADDRESS_MAP_END
438437
439438
440static TIMER_CALLBACK( rjammer_scanline_callback )
439TIMER_CALLBACK_MEMBER(tubep_state::rjammer_scanline_callback)
441440{
442   tubep_state *state = machine.driver_data<tubep_state>();
443441   int scanline = param;
444442
445   state->m_curr_scanline = scanline;//for debugging
443   m_curr_scanline = scanline;//for debugging
446444
447445   /* CPU #0 interrupt */
448446   /* activates at the start of VBLANK signal which happens at the beginning of scaline number 240 */
449447   if (scanline == 240)
450448   {
451449      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);
453451   }
454452
455453
r18112r18113
458456   if (scanline == 16)
459457   {
460458      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);
462460   }
463461
464462
r18112r18113
467465   if (scanline == 16)
468466   {
469467      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);
472470   }
473471   /* CPU #3 MS2010-A NMI */
474472   /* deactivates at the start of VBLANK signal which happens at the beginning of scanline number 240*/
475473   if (scanline == 240)
476474   {
477475      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);
479477   }
480478
481479
r18112r18113
483481   /* activates whenever line V6 from video part goes lo->hi that is when the scanline becomes 64 and 192 */
484482   if ((scanline == 64) || (scanline == 192))
485483   {
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) */
487485   }
488486
489487
490   machine.primary_screen->update_partial(machine.primary_screen->vpos());
488   machine().primary_screen->update_partial(machine().primary_screen->vpos());
491489
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());
493491
494492   scanline++;
495493   if (scanline >= 264)
496494      scanline = 0;
497495
498   state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
496   m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
499497}
500498
501499
502500MACHINE_START_MEMBER(tubep_state,rjammer)
503501{
504502   /* 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));
506504
507505   tubep_setup_save_state(machine());
508506}
trunk/src/mame/drivers/runaway.c
r18112r18113
1717#include "includes/runaway.h"
1818
1919
20static TIMER_CALLBACK( interrupt_callback )
20TIMER_CALLBACK_MEMBER(runaway_state::interrupt_callback)
2121{
22   runaway_state *state = machine.driver_data<runaway_state>();
2322   /* assume Centipede-style interrupt timing */
2423   int scanline = param;
2524
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);
2726
2827   scanline += 32;
2928
3029   if (scanline >= 263)
3130      scanline = 16;
3231
33   state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
32   m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
3433}
3534
3635void runaway_state::machine_start()
3736{
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));
3938}
4039
4140void runaway_state::machine_reset()
trunk/src/mame/drivers/segas32.c
r18112r18113
562562}
563563
564564
565static TIMER_CALLBACK( end_of_vblank_int )
565TIMER_CALLBACK_MEMBER(segas32_state::end_of_vblank_int)
566566{
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);
569569}
570570
571571
r18112r18113
573573{
574574   signal_v60_irq(machine(), MAIN_IRQ_VBSTART);
575575   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));
577577   if (m_system32_prot_vblank)
578578      (*m_system32_prot_vblank)(&device);
579579}
trunk/src/mame/drivers/simpsons.c
r18112r18113
120120}
121121#endif
122122
123static TIMER_CALLBACK( nmi_callback )
123TIMER_CALLBACK_MEMBER(simpsons_state::nmi_callback)
124124{
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);
127126}
128127
129128WRITE8_MEMBER(simpsons_state::z80_arm_nmi_w)
130129{
131130   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 */
133132}
134133
135134static ADDRESS_MAP_START( z80_map, AS_PROGRAM, 8, simpsons_state )
r18112r18113
252251   if (num_inactive) do { *dst = 0; dst += 8; } while (--num_inactive);
253252}
254253
255static TIMER_CALLBACK( dmaend_callback )
254TIMER_CALLBACK_MEMBER(simpsons_state::dmaend_callback)
256255{
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);
260258}
261259
262260
r18112r18113
267265   {
268266      simpsons_objdma(machine());
269267      // 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));
271269   }
272270
273271   if (k052109_is_irq_enabled(m_k052109))
trunk/src/mame/drivers/hyprduel.c
r18112r18113
5353   state->m_maincpu->set_input_line(3, (irq & state->m_int_num) ? ASSERT_LINE : CLEAR_LINE);
5454}
5555
56static TIMER_CALLBACK( vblank_end_callback )
56TIMER_CALLBACK_MEMBER(hyprduel_state::vblank_end_callback)
5757{
58   hyprduel_state *state = machine.driver_data<hyprduel_state>();
59   state->m_requested_int &= ~param;
58   m_requested_int &= ~param;
6059}
6160
6261static TIMER_DEVICE_CALLBACK( hyprduel_interrupt )
r18112r18113
7069      state->m_requested_int |= 0x20;
7170      state->m_maincpu->set_input_line(2, HOLD_LINE);
7271      /* 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);
7473   }
7574   else
7675      state->m_requested_int |= 0x12;      /* hsync */
r18112r18113
181180}
182181
183182
184static TIMER_CALLBACK( magerror_irq_callback )
183TIMER_CALLBACK_MEMBER(hyprduel_state::magerror_irq_callback)
185184{
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);
188186}
189187
190188/***************************************************************************
r18112r18113
256254
257255***************************************************************************/
258256
259static TIMER_CALLBACK( hyprduel_blit_done )
257TIMER_CALLBACK_MEMBER(hyprduel_state::hyprduel_blit_done)
260258{
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());
264261}
265262
266263INLINE int blt_read( const UINT8 *ROM, const int offs )
r18112r18113
332329                       another blit. */
333330               if (b1 == 0)
334331               {
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));
336333                  return;
337334               }
338335
r18112r18113
813810{
814811
815812   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));
817814}
818815
819816
trunk/src/mame/drivers/asuka.c
r18112r18113
230230                INTERRUPTS
231231***********************************************************/
232232
233static TIMER_CALLBACK( cadash_interrupt5 )
233TIMER_CALLBACK_MEMBER(asuka_state::cadash_interrupt5)
234234{
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);
237236}
238237
239238INTERRUPT_GEN_MEMBER(asuka_state::cadash_interrupt)
240239{
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));
242241   device.execute().set_input_line(4, HOLD_LINE);  /* interrupt vector 4 */
243242}
244243
trunk/src/mame/drivers/asterix.c
r18112r18113
6969   return k053260_r(device, space, 2 + offset);
7070}
7171
72static TIMER_CALLBACK( nmi_callback )
72TIMER_CALLBACK_MEMBER(asterix_state::nmi_callback)
7373{
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);
7675}
7776
7877WRITE8_MEMBER(asterix_state::sound_arm_nmi_w)
7978{
8079
8180   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));
8382}
8483
8584WRITE16_MEMBER(asterix_state::sound_irq_w)
trunk/src/mame/drivers/fgoal.c
r18112r18113
6969}
7070
7171
72static TIMER_CALLBACK( interrupt_callback )
72TIMER_CALLBACK_MEMBER(fgoal_state::interrupt_callback)
7373{
74   fgoal_state *state = machine.driver_data<fgoal_state>();
7574   int scanline;
76   int coin = (state->ioport("IN1")->read() & 2);
75   int coin = (ioport("IN1")->read() & 2);
7776
78   state->m_maincpu->set_input_line(0, ASSERT_LINE);
77   m_maincpu->set_input_line(0, ASSERT_LINE);
7978
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);
8281
83   state->m_prev_coin = coin;
82   m_prev_coin = coin;
8483
85   scanline = machine.primary_screen->vpos() + 128;
84   scanline = machine().primary_screen->vpos() + 128;
8685
8786   if (scanline > 256)
8887      scanline = 0;
8988
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));
9190}
9291
9392
r18112r18113
346345void fgoal_state::machine_reset()
347346{
348347
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));
350349
351350   m_xpos = 0;
352351   m_ypos = 0;
trunk/src/mame/drivers/suprridr.c
r18112r18113
113113 *
114114 *************************************/
115115
116static TIMER_CALLBACK( delayed_sound_w )
116TIMER_CALLBACK_MEMBER(suprridr_state::delayed_sound_w)
117117{
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);
121120}
122121
123122
124123WRITE8_MEMBER(suprridr_state::sound_data_w)
125124{
126   machine().scheduler().synchronize(FUNC(delayed_sound_w), data);
125   machine().scheduler().synchronize(timer_expired_delegate(FUNC(suprridr_state::delayed_sound_w),this), data);
127126}
128127
129128
trunk/src/mame/drivers/sslam.c
r18112r18113
213213
214214
215215
216static TIMER_CALLBACK( music_playback )
216TIMER_CALLBACK_MEMBER(sslam_state::music_playback)
217217{
218   sslam_state *state = machine.driver_data<sslam_state>();
219218   int pattern = 0;
220   okim6295_device *device = machine.device<okim6295_device>("oki");
219   okim6295_device *device = machine().device<okim6295_device>("oki");
221220
222221   if ((device->read_status() & 0x08) == 0)
223222   {
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];
226225
227226      if (pattern) {
228227         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];
231230         }
232231         logerror("Changing bar in music track to pattern %02x\n",pattern);
233232         device->write_command(0x80 | pattern);
234233         device->write_command(0x81);
235234      }
236235      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);
241240      }
242241   }
243242
244243   if (0)
245244   {
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);
248247   }
249248}
250249
r18112r18113
926925   save_item(NAME(m_bar));
927926   save_item(NAME(m_snd_bank));
928927
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));
930929}
931930
932931DRIVER_INIT_MEMBER(sslam_state,powerbls)
trunk/src/mame/drivers/skullxbo.c
r18112r18113
4040}
4141
4242
43static TIMER_CALLBACK( irq_gen )
43TIMER_CALLBACK_MEMBER(skullxbo_state::irq_gen)
4444{
45   atarigen_scanline_int_gen(machine.device("maincpu"));
45   atarigen_scanline_int_gen(machine().device("maincpu"));
4646}
4747
4848
r18112r18113
5757   {
5858      int   width = screen.width();
5959      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));
6161   }
6262
6363   /* update the playfield and motion objects */
trunk/src/mame/drivers/orbit.c
r18112r18113
4040}
4141
4242
43static TIMER_CALLBACK( irq_off )
43TIMER_CALLBACK_MEMBER(orbit_state::irq_off)
4444{
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);
4746}
4847
4948
5049INTERRUPT_GEN_MEMBER(orbit_state::orbit_interrupt)
5150{
5251   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));
5453}
5554
5655
trunk/src/mame/drivers/tankbust.c
r18112r18113
2424
2525//port A of ay8910#0
2626
27static TIMER_CALLBACK( soundlatch_callback )
27TIMER_CALLBACK_MEMBER(tankbust_state::soundlatch_callback)
2828{
29   tankbust_state *state = machine.driver_data<tankbust_state>();
30   state->m_latch = param;
29   m_latch = param;
3130}
3231
3332WRITE8_MEMBER(tankbust_state::tankbust_soundlatch_w)
3433{
35   machine().scheduler().synchronize(FUNC(soundlatch_callback), data);
34   machine().scheduler().synchronize(timer_expired_delegate(FUNC(tankbust_state::soundlatch_callback),this), data);
3635}
3736
3837READ8_MEMBER(tankbust_state::tankbust_soundlatch_r)
r18112r18113
5049   return ret;
5150}
5251
53static TIMER_CALLBACK( soundirqline_callback )
52TIMER_CALLBACK_MEMBER(tankbust_state::soundirqline_callback)
5453{
5554//logerror("sound_irq_line write = %2x (after CPUs synced) \n",param);
5655
5756      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);
5958}
6059
6160
r18112r18113
7978      break;
8079
8180   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);
8382      break;
8483
8584   case 2:   /* 0xe002 coin counter */
trunk/src/mame/drivers/galastrm.c
r18112r18113
5454   device.execute().set_input_line(5, HOLD_LINE);
5555}
5656
57static TIMER_CALLBACK( galastrm_interrupt6 )
57TIMER_CALLBACK_MEMBER(galastrm_state::galastrm_interrupt6)
5858{
59   machine.device("maincpu")->execute().set_input_line(6, HOLD_LINE);
59   machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE);
6060}
6161
6262
r18112r18113
158158
159159WRITE32_MEMBER(galastrm_state::galastrm_adstick_ctrl_w)
160160{
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));
162162}
163163
164164/***********************************************************
trunk/src/mame/drivers/tetrisp2.c
r18112r18113
12481248
12491249***************************************************************************/
12501250
1251static TIMER_CALLBACK( rockn_timer_level4_callback )
1251TIMER_CALLBACK_MEMBER(tetrisp2_state::rockn_timer_level4_callback)
12521252{
1253   machine.device("maincpu")->execute().set_input_line(4, HOLD_LINE);
1253   machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
12541254}
12551255
1256static TIMER_CALLBACK( rockn_timer_sub_level4_callback )
1256TIMER_CALLBACK_MEMBER(tetrisp2_state::rockn_timer_sub_level4_callback)
12571257{
1258   machine.device("sub")->execute().set_input_line(4, HOLD_LINE);
1258   machine().device("sub")->execute().set_input_line(4, HOLD_LINE);
12591259}
12601260
12611261
1262static TIMER_CALLBACK( rockn_timer_level1_callback )
1262TIMER_CALLBACK_MEMBER(tetrisp2_state::rockn_timer_level1_callback)
12631263{
1264   machine.device("maincpu")->execute().set_input_line(1, HOLD_LINE);
1264   machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
12651265}
12661266
1267static TIMER_CALLBACK( rockn_timer_sub_level1_callback )
1267TIMER_CALLBACK_MEMBER(tetrisp2_state::rockn_timer_sub_level1_callback)
12681268{
1269   machine.device("sub")->execute().set_input_line(1, HOLD_LINE);
1269   machine().device("sub")->execute().set_input_line(1, HOLD_LINE);
12701270}
12711271
12721272static void init_rockn_timer(running_machine &machine)
12731273{
12741274   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));
12771277
12781278   state_save_register_global_array(machine, state->m_systemregs);
12791279   state_save_register_global_array(machine, state->m_rocknms_sub_systemregs);
r18112r18113
13041304{
13051305   init_rockn_timer(machine());
13061306
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));
13091309
13101310   m_rockn_protectdata = 3;
13111311
trunk/src/mame/drivers/namcos22.c
r18112r18113
27052705   }
27062706}
27072707
2708static TIMER_CALLBACK( alpine_steplock_callback )
2708TIMER_CALLBACK_MEMBER(namcos22_state::alpine_steplock_callback)
27092709{
2710   namcos22_state *state = machine.driver_data<namcos22_state>();
2711   state->m_motor_status = param;
2710   m_motor_status = param;
27122711}
27132712
27142713WRITE8_MEMBER(namcos22_state::alpine_mcu_port5_w)
r18112r18113
54865485   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));
54875486   state->m_mcu->space(AS_IO).install_write_handler(M37710_PORT5, M37710_PORT5, write8_delegate(FUNC(namcos22_state::alpine_mcu_port5_w),state));
54885487
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));
54905489   state->m_motor_timer->reset();
54915490   state->m_motor_status = 2;
54925491}
trunk/src/mame/drivers/midvunit.c
r18112r18113
132132}
133133
134134
135static TIMER_CALLBACK( adc_ready )
135TIMER_CALLBACK_MEMBER(midvunit_state::adc_ready)
136136{
137   machine.device("maincpu")->execute().set_input_line(3, ASSERT_LINE);
137   machine().device("maincpu")->execute().set_input_line(3, ASSERT_LINE);
138138}
139139
140140
r18112r18113
148148      if (which < 0 || which > 2)
149149         logerror("adc_w: unexpected which = %02X\n", which + 4);
150150      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));
152152   }
153153   else
154154      logerror("adc_w without enabling writes!\n");
trunk/src/mame/drivers/bigevglf.c
r18112r18113
7373   membank("bank1")->set_entry(m_beg_bank & 0xff); /* empty sockets for IC37-IC44 ROMS */
7474}
7575
76static TIMER_CALLBACK( from_sound_latch_callback )
76TIMER_CALLBACK_MEMBER(bigevglf_state::from_sound_latch_callback)
7777{
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;
8180}
8281WRITE8_MEMBER(bigevglf_state::beg_fromsound_w)/* write to D800 sets bit 1 in status */
8382{
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);
8584}
8685
8786READ8_MEMBER(bigevglf_state::beg_fromsound_r)
r18112r18113
107106   return m_sound_state;
108107}
109108
110static TIMER_CALLBACK( nmi_callback )
109TIMER_CALLBACK_MEMBER(bigevglf_state::nmi_callback)
111110{
112   bigevglf_state *state = machine.driver_data<bigevglf_state>();
113111
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);
116114   else
117      state->m_pending_nmi = 1;
118   state->m_sound_state &= ~1;
115      m_pending_nmi = 1;
116   m_sound_state &= ~1;
119117}
120118
121119WRITE8_MEMBER(bigevglf_state::sound_command_w)/* write to port 20 clears bit 0 in status */
122120{
123121   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);
125123}
126124
127125READ8_MEMBER(bigevglf_state::sound_command_r)/* read from D800 sets bit 0 in status */
r18112r18113
145143   }
146144}
147145
148static TIMER_CALLBACK( deferred_ls74_w )
146TIMER_CALLBACK_MEMBER(bigevglf_state::deferred_ls74_w)
149147{
150   bigevglf_state *state = machine.driver_data<bigevglf_state>();
151148   int offs = (param >> 8) & 255;
152149   int data = param & 255;
153   state->m_beg13_ls74[offs] = data;
150   m_beg13_ls74[offs] = data;
154151}
155152
156153/* do this on a timer to let the CPUs synchronize */
157154WRITE8_MEMBER(bigevglf_state::beg13_a_clr_w)
158155{
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);
160157}
161158
162159WRITE8_MEMBER(bigevglf_state::beg13_b_clr_w)
163160{
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);
165162}
166163
167164WRITE8_MEMBER(bigevglf_state::beg13_a_set_w)
168165{
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);
170167}
171168
172169WRITE8_MEMBER(bigevglf_state::beg13_b_set_w)
173170{
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);
175172}
176173
177174READ8_MEMBER(bigevglf_state::beg_status_r)
trunk/src/mame/drivers/namcofl.c
r18112r18113
522522GFXDECODE_END
523523
524524
525static TIMER_CALLBACK( network_interrupt_callback )
525TIMER_CALLBACK_MEMBER(namcofl_state::network_interrupt_callback)
526526{
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));
529529}
530530
531531
532static TIMER_CALLBACK( vblank_interrupt_callback )
532TIMER_CALLBACK_MEMBER(namcofl_state::vblank_interrupt_callback)
533533{
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));
536536}
537537
538538
539static TIMER_CALLBACK( raster_interrupt_callback )
539TIMER_CALLBACK_MEMBER(namcofl_state::raster_interrupt_callback)
540540{
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());
545544}
546545
547546static TIMER_DEVICE_CALLBACK( mcu_irq0_cb )
r18112r18113
568567
569568MACHINE_START_MEMBER(namcofl_state,namcofl)
570569{
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));
572571}
573572
574573
575574MACHINE_RESET_MEMBER(namcofl_state,namcofl)
576575{
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));
579578
580579   membank("bank1")->set_base(memregion("maincpu")->base() );
581580   membank("bank2")->set_base(m_workram );
trunk/src/mame/drivers/itech32.c
r18112r18113
635635 *
636636 *************************************/
637637
638static TIMER_CALLBACK( delayed_sound_data_w )
638TIMER_CALLBACK_MEMBER(itech32_state::delayed_sound_data_w)
639639{
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);
644643}
645644
646645
647646WRITE16_MEMBER(itech32_state::sound_data_w)
648647{
649648   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);
651650}
652651
653652
r18112r18113
660659WRITE32_MEMBER(itech32_state::sound_data32_w)
661660{
662661   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);
664663}
665664
666665
trunk/src/mame/drivers/bombjack.c
r18112r18113
101101#include "includes/bombjack.h"
102102
103103
104static TIMER_CALLBACK( soundlatch_callback )
104TIMER_CALLBACK_MEMBER(bombjack_state::soundlatch_callback)
105105{
106   bombjack_state *state = machine.driver_data<bombjack_state>();
107   state->m_latch = param;
106   m_latch = param;
108107}
109108
110109WRITE8_MEMBER(bombjack_state::bombjack_soundlatch_w)
111110{
112111   /* 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);
114113}
115114
116115READ8_MEMBER(bombjack_state::bombjack_soundlatch_r)
trunk/src/mame/drivers/crgolf.c
r18112r18113
147147 *
148148 *************************************/
149149
150static TIMER_CALLBACK( main_to_sound_callback )
150TIMER_CALLBACK_MEMBER(crgolf_state::main_to_sound_callback)
151151{
152   crgolf_state *state = machine.driver_data<crgolf_state>();
153152
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;
156155}
157156
158157
159158WRITE8_MEMBER(crgolf_state::main_to_sound_w)
160159{
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);
162161}
163162
164163
r18112r18113
177176 *
178177 *************************************/
179178
180static TIMER_CALLBACK( sound_to_main_callback )
179TIMER_CALLBACK_MEMBER(crgolf_state::sound_to_main_callback)
181180{
182   crgolf_state *state = machine.driver_data<crgolf_state>();
183181
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;
186184}
187185
188186
189187WRITE8_MEMBER(crgolf_state::sound_to_main_w)
190188{
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);
192190}
193191
194192
trunk/src/mame/drivers/gcpinbal.c
r18112r18113
4747                      INTERRUPTS
4848***********************************************************/
4949
50static TIMER_CALLBACK( gcpinbal_interrupt1 )
50TIMER_CALLBACK_MEMBER(gcpinbal_state::gcpinbal_interrupt1)
5151{
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);
5453}
5554
5655#ifdef UNUSED_FUNCTION
57static TIMER_CALLBACK( gcpinbal_interrupt3 )
56TIMER_CALLBACK_MEMBER(gcpinbal_state::gcpinbal_interrupt3)
5857{
59   gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
6058   // IRQ3 is from the M6585
6159//  if (!ADPCM_playing(0))
6260   {
63      state->m_maincpu->set_input_line(3, HOLD_LINE);
61      m_maincpu->set_input_line(3, HOLD_LINE);
6462   }
6563}
6664#endif
r18112r18113
6967{
7068   /* Unsure of actual sequence */
7169
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));
7472   device.execute().set_input_line(4, HOLD_LINE);
7573}
7674
trunk/src/mame/drivers/grchamp.c
r18112r18113
384384}
385385
386386
387static TIMER_CALLBACK( main_to_sub_comm_sync_w )
387TIMER_CALLBACK_MEMBER(grchamp_state::main_to_sub_comm_sync_w)
388388{
389   grchamp_state *state = machine.driver_data<grchamp_state>();
390389   int offset = param >> 8;
391   state->m_comm_latch2[offset & 3] = param;
390   m_comm_latch2[offset & 3] = param;
392391}
393392
394393
395394WRITE8_MEMBER(grchamp_state::main_to_sub_comm_w)
396395{
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));
398397}
399398
400399
trunk/src/mame/drivers/othunder.c
r18112r18113
280280   update_irq(machine());
281281}
282282
283static TIMER_CALLBACK( ad_interrupt )
283TIMER_CALLBACK_MEMBER(othunder_state::ad_interrupt)
284284{
285   othunder_state *state = machine.driver_data<othunder_state>();
286285
287   state->m_ad_irq = 1;
288   update_irq(machine);
286   m_ad_irq = 1;
287   update_irq(machine());
289288}
290289
291290
r18112r18113
381380       The ADC60808 clock is 512kHz. Conversion takes between 0 and 8 clock
382381       cycles, so would end in a maximum of 15.625us. We'll use 10. */
383382
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));
385384}
386385
387386
trunk/src/mame/drivers/toypop.c
r18112r18113
7979   m_sound_irq_mask = 0;
8080}
8181
82static TIMER_CALLBACK( namcoio_run )
82TIMER_CALLBACK_MEMBER(toypop_state::namcoio_run)
8383{
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");
8787
8888   switch (param)
8989   {
r18112r18113
109109      device.execute().set_input_line(0, HOLD_LINE);
110110
111111   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));
113113
114114   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);
116116
117117   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);
119119
120120}
121121
trunk/src/mame/drivers/sprint4.c
r18112r18113
4141}
4242
4343
44static TIMER_CALLBACK( nmi_callback   )
44TIMER_CALLBACK_MEMBER(sprint4_state::nmi_callback)
4545{
46   sprint4_state *state = machine.driver_data<sprint4_state>();
4746   int scanline = param;
4847
4948   /* MAME updates controls only once per frame but the game checks them on every NMI */
5049
5150   UINT8 wheel[4] =
5251   {
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()
5756   };
5857   UINT8 lever[4] =
5958   {
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()
6463   };
6564
6665   int i;
r18112r18113
6968
7069   for (i = 0; i < 4; i++)
7170   {
72      signed char delta = wheel[i] - state->m_last_wheel[i];
71      signed char delta = wheel[i] - m_last_wheel[i];
7372
7473      if (delta < 0)
7574      {
76         state->m_steer_FF2[i] = 0;
75         m_steer_FF2[i] = 0;
7776      }
7877      if (delta > 0)
7978      {
80         state->m_steer_FF2[i] = 1;
79         m_steer_FF2[i] = 1;
8180      }
8281
83      state->m_steer_FF1[i] = (wheel[i] >> 4) & 1;
82      m_steer_FF1[i] = (wheel[i] >> 4) & 1;
8483
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; }
8988
90      state->m_last_wheel[i] = wheel[i];
89      m_last_wheel[i] = wheel[i];
9190   }
9291
9392   scanline += 64;
r18112r18113
9998
10099   /* NMI and watchdog are disabled during service mode */
101100
102   machine.watchdog_enable(machine.root_device().ioport("IN0")->read() & 0x40);
101   machine().watchdog_enable(machine().root_device().ioport("IN0")->read() & 0x40);
103102
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);
106105
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);
108107}
109108
110109
111110void sprint4_state::machine_reset()
112111{
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);
114113
115114   memset(m_steer_FF1, 0, sizeof m_steer_FF1);
116115   memset(m_steer_FF2, 0, sizeof m_steer_FF2);
trunk/src/mame/drivers/ladyfrog.c
r18112r18113
7070   m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 1 ) ? ASSERT_LINE : CLEAR_LINE);
7171}
7272
73static TIMER_CALLBACK( nmi_callback )
73TIMER_CALLBACK_MEMBER(ladyfrog_state::nmi_callback)
7474{
75   ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
7675
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);
7978   else
80      state->m_pending_nmi = 1;
79      m_pending_nmi = 1;
8180}
8281
8382WRITE8_MEMBER(ladyfrog_state::sound_command_w)
8483{
8584   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);
8786}
8887
8988WRITE8_MEMBER(ladyfrog_state::nmi_disable_w)
trunk/src/mame/drivers/esripsys.c
r18112r18113
163163 *
164164 *************************************/
165165
166static TIMER_CALLBACK( delayed_bank_swap )
166TIMER_CALLBACK_MEMBER(esripsys_state::delayed_bank_swap)
167167{
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;
171170}
172171
173172WRITE8_MEMBER(esripsys_state::frame_w)
174173{
175   machine().scheduler().synchronize(FUNC(delayed_bank_swap));
174   machine().scheduler().synchronize(timer_expired_delegate(FUNC(esripsys_state::delayed_bank_swap),this));
176175   m_frame_vbl = 1;
177176}
178177
trunk/src/mame/drivers/qdrmfgp.c
r18112r18113
293293
294294/*************/
295295
296static TIMER_CALLBACK( gp2_timer_callback )
296TIMER_CALLBACK_MEMBER(qdrmfgp_state::gp2_timer_callback)
297297{
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);
301300}
302301
303302INTERRUPT_GEN_MEMBER(qdrmfgp_state::qdrmfgp2_interrupt)
r18112r18113
644643MACHINE_START_MEMBER(qdrmfgp_state,qdrmfgp2)
645644{
646645   /* 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));
648647
649648   MACHINE_START_CALL_MEMBER( qdrmfgp );
650649}
trunk/src/mame/drivers/neogeo.c
r18112r18113
268268}
269269
270270
271static TIMER_CALLBACK( display_position_interrupt_callback )
271TIMER_CALLBACK_MEMBER(neogeo_state::display_position_interrupt_callback)
272272{
273   neogeo_state *state = machine.driver_data<neogeo_state>();
274273
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());
276275
277   if (state->m_display_position_interrupt_control & IRQ2CTRL_ENABLE)
276   if (m_display_position_interrupt_control & IRQ2CTRL_ENABLE)
278277   {
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;
281280
282      update_interrupts(machine);
281      update_interrupts(machine());
283282   }
284283
285   if (state->m_display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_REPEAT)
284   if (m_display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_REPEAT)
286285   {
287286      if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_REPEAT ");
288      adjust_display_position_interrupt_timer(machine);
287      adjust_display_position_interrupt_timer(machine());
289288   }
290289}
291290
292291
293static TIMER_CALLBACK( display_position_vblank_callback )
292TIMER_CALLBACK_MEMBER(neogeo_state::display_position_vblank_callback)
294293{
295   neogeo_state *state = machine.driver_data<neogeo_state>();
296294
297   if (state->m_display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_VBLANK)
295   if (m_display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_VBLANK)
298296   {
299297      if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_VBLANK ");
300      adjust_display_position_interrupt_timer(machine);
298      adjust_display_position_interrupt_timer(machine());
301299   }
302300
303301   /* set timer for next screen */
304   state->m_display_position_vblank_timer->adjust(machine.primary_screen->time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS));
302   m_display_position_vblank_timer->adjust(machine().primary_screen->time_until_pos(NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS));
305303}
306304
307305
308static TIMER_CALLBACK( vblank_interrupt_callback )
306TIMER_CALLBACK_MEMBER(neogeo_state::vblank_interrupt_callback)
309307{
310   neogeo_state *state = machine.driver_data<neogeo_state>();
311308
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());
313310
314311   /* add a timer tick to the pd4990a */
315   upd4990a_addretrace(state->m_upd4990a);
312   upd4990a_addretrace(m_upd4990a);
316313
317   state->m_vblank_interrupt_pending = 1;
314   m_vblank_interrupt_pending = 1;
318315
319   update_interrupts(machine);
316   update_interrupts(machine());
320317
321318   /* set timer for next screen */
322   state->m_vblank_interrupt_timer->adjust(machine.primary_screen->time_until_pos(NEOGEO_VBSTART));
319   m_vblank_interrupt_timer->adjust(machine().primary_screen->time_until_pos(NEOGEO_VBSTART));
323320}
324321
325322
326323static void create_interrupt_timers( running_machine &machine )
327324{
328325   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));
332329}
333330
334331
trunk/src/mame/drivers/cave.c
r18112r18113
113113      state->m_maincpu->set_input_line(state->m_irq_level, CLEAR_LINE);
114114}
115115
116static TIMER_CALLBACK( cave_vblank_end )
116TIMER_CALLBACK_MEMBER(cave_state::cave_vblank_end)
117117{
118   cave_state *state = machine.driver_data<cave_state>();
119   if (state->m_kludge == 3)   /* mazinger metmqstr */
118   if (m_kludge == 3)   /* mazinger metmqstr */
120119   {
121      state->m_unknown_irq = 1;
122      update_irq_state(machine);
120      m_unknown_irq = 1;
121      update_irq_state(machine());
123122   }
124   state->m_agallet_vblank_irq = 0;
123   m_agallet_vblank_irq = 0;
125124}
126125
127126static TIMER_DEVICE_CALLBACK( cave_vblank_start )
r18112r18113
131130   update_irq_state(timer.machine());
132131   cave_get_sprite_info(timer.machine());
133132   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));
135134}
136135
137136/* Called once/frame to generate the VBLANK interrupt */
trunk/src/mame/drivers/dec8.c
r18112r18113
129129*
130130***************************************************/
131131
132static TIMER_CALLBACK( dec8_i8751_timer_callback )
132TIMER_CALLBACK_MEMBER(dec8_state::dec8_i8751_timer_callback)
133133{
134134   // The schematics show a clocked LS194 shift register (3A) is used to automatically
135135   // 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);
138137}
139138
140139WRITE8_MEMBER(dec8_state::dec8_i8751_w)
r18112r18113
145144   case 0: /* High byte - SECIRQ is trigged on activating this latch */
146145      m_i8751_value = (m_i8751_value & 0xff) | (data << 8);
147146      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
149148      break;
150149   case 1: /* Low byte */
151150      m_i8751_value = (m_i8751_value & 0xff00) | data;
trunk/src/mame/drivers/cvs.c
r18112r18113
293293   return tms5110_romclk_hack_r(device, space, 0) ? 0x80 : 0;
294294}
295295
296static TIMER_CALLBACK( cvs_393hz_timer_cb )
296TIMER_CALLBACK_MEMBER(cvs_state::cvs_393hz_timer_cb)
297297{
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;
300299
301300   /* quasar.c games use this timer but have no dac3! */
302   if (state->m_dac3 != NULL)
301   if (m_dac3 != NULL)
303302   {
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);
306305   }
307306}
308307
r18112r18113
310309static void start_393hz_timer(running_machine &machine)
311310{
312311   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));
314313   state->m_cvs_393hz_timer->adjust(attotime::from_hz(30*393), 0, attotime::from_hz(30*393));
315314}
316315
trunk/src/mame/drivers/flstory.c
r18112r18113
3434   m_snd_flag = 2;
3535}
3636
37static TIMER_CALLBACK( nmi_callback )
37TIMER_CALLBACK_MEMBER(flstory_state::nmi_callback)
3838{
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);
4241   else
43      state->m_pending_nmi = 1;
42      m_pending_nmi = 1;
4443}
4544
4645WRITE8_MEMBER(flstory_state::sound_command_w)
4746{
4847   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);
5049}
5150
5251
trunk/src/mame/drivers/atetris.c
r18112r18113
6666 *
6767 *************************************/
6868
69static TIMER_CALLBACK( interrupt_gen )
69TIMER_CALLBACK_MEMBER(atetris_state::interrupt_gen)
7070{
71   atetris_state *state = machine.driver_data<atetris_state>();
7271   int scanline = param;
7372
7473   /* 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);
7675
7776   /* set the next timer */
7877   scanline += 32;
7978   if (scanline >= 256)
8079      scanline -= 256;
81   state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
80   m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
8281}
8382
8483
r18112r18113
107106{
108107
109108   /* 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));
111110
112111   /* Set up save state */
113112   save_item(NAME(m_current_bank));
trunk/src/mame/drivers/gunbustr.c
r18112r18113
5252
5353/*********************************************************************/
5454
55static TIMER_CALLBACK( gunbustr_interrupt5 )
55TIMER_CALLBACK_MEMBER(gunbustr_state::gunbustr_interrupt5)
5656{
57   machine.device("maincpu")->execute().set_input_line(5, HOLD_LINE);
57   machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
5858}
5959
6060INTERRUPT_GEN_MEMBER(gunbustr_state::gunbustr_interrupt)
6161{
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));
6363   device.execute().set_input_line(4, HOLD_LINE);
6464}
6565
r18112r18113
143143WRITE32_MEMBER(gunbustr_state::gunbustr_gun_w)
144144{
145145   /* 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));
147147}
148148
149149
trunk/src/mame/drivers/metro.c
r18112r18113
201201   update_irq_state(machine());
202202}
203203
204static TIMER_CALLBACK( karatour_irq_callback )
204TIMER_CALLBACK_MEMBER(metro_state::karatour_irq_callback)
205205{
206   metro_state *state = machine.driver_data<metro_state>();
207   state->m_requested_int[5] = 0;
206   m_requested_int[5] = 0;
208207}
209208
210209/* lev 2-7 (lev 1 seems sound related) */
r18112r18113
214213   m_requested_int[m_vblank_bit] = 1;
215214
216215   /* 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));
218217   m_requested_int[5] = 1;
219218
220219   update_irq_state(machine());
221220}
222221
223static TIMER_CALLBACK( mouja_irq_callback )
222TIMER_CALLBACK_MEMBER(metro_state::mouja_irq_callback)
224223{
225   metro_state *state = machine.driver_data<metro_state>();
226224
227   state->m_requested_int[0] = 1;
228   update_irq_state(machine);
225   m_requested_int[0] = 1;
226   update_irq_state(machine());
229227}
230228
231229WRITE16_MEMBER(metro_state::mouja_irq_timer_ctrl_w)
r18112r18113
564562
565563***************************************************************************/
566564
567static TIMER_CALLBACK( metro_blit_done )
565TIMER_CALLBACK_MEMBER(metro_state::metro_blit_done)
568566{
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());
572569}
573570
574571INLINE int blt_read( const UINT8 *ROM, const int offs )
r18112r18113
639636                       another blit. */
640637            if (b1 == 0)
641638            {
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));
643640               return;
644641            }
645642
r18112r18113
60336030   metro_common(machine());
60346031   m_irq_line = -1;   /* split interrupt handlers */
60356032   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));
60376034}
60386035
60396036DRIVER_INIT_MEMBER(metro_state,gakusai)
trunk/src/mame/drivers/konamigx.c
r18112r18113
597597    12Mhz dotclock: 42.7us(clear) / 341.3us(transfer)
598598*/
599599
600static TIMER_CALLBACK( dmaend_callback )
600TIMER_CALLBACK_MEMBER(konamigx_state::dmaend_callback)
601601{
602602   // 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); }
604604
605605   // DMA busy flag must be cleared before triggering IRQ 3
606606   gx_rdport1_3 &= ~2;
r18112r18113
612612
613613      // lower OBJINT-REQ flag and trigger interrupt
614614      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);
616616   }
617617}
618618
r18112r18113
37293729   snd020_hack = 0;
37303730   resume_trigger = 0;
37313731
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));
37333733   i = match = 0;
37343734   while ((gameDefs[i].cfgport != -1) && (!match))
37353735   {
trunk/src/mame/drivers/parodius.c
r18112r18113
121121}
122122#endif
123123
124static TIMER_CALLBACK( nmi_callback )
124TIMER_CALLBACK_MEMBER(parodius_state::nmi_callback)
125125{
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);
128127}
129128
130129WRITE8_MEMBER(parodius_state::sound_arm_nmi_w)
131130{
132131
133132   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 */
135134}
136135
137136/********************************************/
trunk/src/mame/drivers/rpunch.c
r18112r18113
156156 *
157157 *************************************/
158158
159static TIMER_CALLBACK( sound_command_w_callback )
159TIMER_CALLBACK_MEMBER(rpunch_state::sound_command_w_callback)
160160{
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);
165164}
166165
167166
168167WRITE16_MEMBER(rpunch_state::sound_command_w)
169168{
170169   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);
172171}
173172
174173
trunk/src/mame/drivers/cloud9.c
r18112r18113
122122}
123123
124124
125static TIMER_CALLBACK( clock_irq )
125TIMER_CALLBACK_MEMBER(cloud9_state::clock_irq)
126126{
127   cloud9_state *state = machine.driver_data<cloud9_state>();
128127   /* assert the IRQ if not already asserted */
129   if (!state->m_irq_state)
128   if (!m_irq_state)
130129   {
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;
133132   }
134133
135134   /* force an update now */
136   machine.primary_screen->update_partial(machine.primary_screen->vpos());
135   machine().primary_screen->update_partial(machine().primary_screen->vpos());
137136
138137   /* find the next edge */
139   schedule_next_irq(machine, param);
138   schedule_next_irq(machine(), param);
140139}
141140
142141
r18112r18113
181180   machine().primary_screen->configure(320, 256, visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL);
182181
183182   /* 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));
185184   m_irq_state = 0;
186185   schedule_next_irq(machine(), 0-64);
187186
trunk/src/mame/drivers/jedi.c
r18112r18113
123123 *
124124 *************************************/
125125
126static TIMER_CALLBACK( generate_interrupt )
126TIMER_CALLBACK_MEMBER(jedi_state::generate_interrupt)
127127{
128   jedi_state *state = machine.driver_data<jedi_state>();
129128   int scanline = param;
130129
131130   /* 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);
134133
135134   /* set up for the next */
136135   scanline += 32;
137136   if (scanline > 256)
138137      scanline = 32;
139   state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
138   m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
140139}
141140
142141
r18112r18113
157156{
158157
159158   /* 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));
161160   m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(32), 32);
162161
163162   /* configure the banks */
trunk/src/mame/drivers/vendetta.c
r18112r18113
198198   k053246_set_objcha_line(m_k053246, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
199199}
200200
201static TIMER_CALLBACK( z80_nmi_callback )
201TIMER_CALLBACK_MEMBER(vendetta_state::z80_nmi_callback)
202202{
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);
205204}
206205
207206WRITE8_MEMBER(vendetta_state::z80_arm_nmi_w)
208207{
209208   m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
210209
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));
212211}
213212
214213WRITE8_MEMBER(vendetta_state::z80_irq_w)
trunk/src/mame/drivers/taito_f3.c
r18112r18113
390390
391391/******************************************************************************/
392392
393static TIMER_CALLBACK( f3_interrupt3 )
393TIMER_CALLBACK_MEMBER(taito_f3_state::f3_interrupt3)
394394{
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?
396396}
397397
398398INTERRUPT_GEN_MEMBER(taito_f3_state::f3_interrupt2)
399399{
400400   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));
402402}
403403
404404static SOUND_RESET( f3 )
trunk/src/mame/drivers/champbas.c
r18112r18113
134134      m_maincpu->set_input_line(0, CLEAR_LINE);
135135}
136136
137static TIMER_CALLBACK( exctsccr_fm_callback )
137TIMER_CALLBACK_MEMBER(champbas_state::exctsccr_fm_callback)
138138{
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);
141140}
142141
143142// Champion Baseball has only one DAC
r18112r18113
591590   m_audiocpu = machine().device<cpu_device>("audiocpu");
592591
593592   // 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 */
595594
596595   MACHINE_START_CALL_MEMBER(champbas);
597596}
trunk/src/mame/drivers/exterm.c
r18112r18113
170170}
171171
172172
173static TIMER_CALLBACK( sound_delayed_w )
173TIMER_CALLBACK_MEMBER(exterm_state::sound_delayed_w)
174174{
175   exterm_state *state = machine.driver_data<exterm_state>();
176175   /* 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);
180179}
181180
182181
183182WRITE16_MEMBER(exterm_state::sound_latch_w)
184183{
185184   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);
187186}
188187
189188
trunk/src/mame/drivers/fuukifg3.c
r18112r18113
522522
523523***************************************************************************/
524524
525static TIMER_CALLBACK( level_1_interrupt_callback )
525TIMER_CALLBACK_MEMBER(fuuki32_state::level_1_interrupt_callback)
526526{
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));
530529}
531530
532531
533static TIMER_CALLBACK( vblank_interrupt_callback )
532TIMER_CALLBACK_MEMBER(fuuki32_state::vblank_interrupt_callback)
534533{
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));
538536}
539537
540538
541static TIMER_CALLBACK( raster_interrupt_callback )
539TIMER_CALLBACK_MEMBER(fuuki32_state::raster_interrupt_callback)
542540{
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());
547544}
548545
549546
r18112r18113
556553   m_maincpu = machine().device<cpu_device>("maincpu");
557554   m_audiocpu = machine().device<cpu_device>("soundcpu");
558555
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));
560557
561558   save_item(NAME(m_spr_buffered_tilebank));
562559   save_item(NAME(m_shared_ram));
r18112r18113
567564{
568565   const rectangle &visarea = machine().primary_screen->visible_area();
569566
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));
572569   m_raster_interrupt_timer->adjust(machine().primary_screen->time_until_pos(0, visarea.max_x + 1));
573570}
574571
trunk/src/mame/drivers/wolfpack.c
r18112r18113
99#include "sound/s14001a.h"
1010#include "includes/wolfpack.h"
1111
12static TIMER_CALLBACK( periodic_callback )
12TIMER_CALLBACK_MEMBER(wolfpack_state::periodic_callback)
1313{
1414   int scanline = param;
1515
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);
1717
1818   scanline += 64;
1919
2020   if (scanline >= 262)
2121      scanline = 0;
2222
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);
2424}
2525
2626
2727void wolfpack_state::machine_reset()
2828{
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));
3030}
3131
3232
trunk/src/mame/drivers/nycaptor.c
r18112r18113
270270   }
271271}
272272
273static TIMER_CALLBACK( nmi_callback )
273TIMER_CALLBACK_MEMBER(nycaptor_state::nmi_callback)
274274{
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);
278277   else
279      state->m_pending_nmi = 1;
278      m_pending_nmi = 1;
280279}
281280
282281WRITE8_MEMBER(nycaptor_state::sound_command_w)
283282{
284283   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);
286285}
287286
288287WRITE8_MEMBER(nycaptor_state::nmi_disable_w)
trunk/src/mame/drivers/trucocl.c
r18112r18113
4444}
4545
4646
47static TIMER_CALLBACK( dac_irq )
47TIMER_CALLBACK_MEMBER(trucocl_state::dac_irq)
4848{
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 );
5050}
5151
5252WRITE8_MEMBER(trucocl_state::audio_dac_w)
r18112r18113
7676
7777   device->write_unsigned8( rom[dac_address+m_cur_dac_address_index] );
7878
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));
8080}
8181
8282static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, trucocl_state )
trunk/src/mame/drivers/ccastles.c
r18112r18113
152152}
153153
154154
155static TIMER_CALLBACK( clock_irq )
155TIMER_CALLBACK_MEMBER(ccastles_state::clock_irq)
156156{
157   ccastles_state *state = machine.driver_data<ccastles_state>();
158157
159158   /* assert the IRQ if not already asserted */
160   if (!state->m_irq_state)
159   if (!m_irq_state)
161160   {
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;
164163   }
165164
166165   /* force an update now */
167   machine.primary_screen->update_partial(machine.primary_screen->vpos());
166   machine().primary_screen->update_partial(machine().primary_screen->vpos());
168167
169168   /* find the next edge */
170   schedule_next_irq(machine, param);
169   schedule_next_irq(machine(), param);
171170}
172171
173172
r18112r18113
215214   membank("bank1")->configure_entries(0, 2, memregion("maincpu")->base() + 0xa000, 0x6000);
216215
217216   /* 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));
219218   m_irq_state = 0;
220219   schedule_next_irq(machine(), 0);
221220
trunk/src/mame/drivers/policetr.c
r18112r18113
101101 *
102102 *************************************/
103103
104static TIMER_CALLBACK( irq5_gen )
104TIMER_CALLBACK_MEMBER(policetr_state::irq5_gen)
105105{
106   machine.device("maincpu")->execute().set_input_line(R3000_IRQ5, ASSERT_LINE);
106   machine().device("maincpu")->execute().set_input_line(R3000_IRQ5, ASSERT_LINE);
107107}
108108
109109
110110INTERRUPT_GEN_MEMBER(policetr_state::irq4_gen)
111111{
112112   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));
114114}
115115
116116
trunk/src/mame/drivers/gijoe.c
r18112r18113
108108   }
109109}
110110
111static TIMER_CALLBACK( dmaend_callback )
111TIMER_CALLBACK_MEMBER(gijoe_state::dmaend_callback)
112112{
113   gijoe_state *state = machine.driver_data<gijoe_state>();
114113
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);
117116}
118117
119118INTERRUPT_GEN_MEMBER(gijoe_state::gijoe_interrupt)
r18112r18113
280279   m_k053246 = machine().device("k053246");
281280   m_k053251 = machine().device("k053251");
282281
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));
284283
285284   save_item(NAME(m_cur_control2));
286285}
trunk/src/mame/drivers/itech8.c
r18112r18113
604604 *
605605 *************************************/
606606
607static TIMER_CALLBACK( irq_off )
607TIMER_CALLBACK_MEMBER(itech8_state::irq_off)
608608{
609   itech8_update_interrupts(machine, 0, -1, -1);
609   itech8_update_interrupts(machine(), 0, -1, -1);
610610}
611611
612612
r18112r18113
614614{
615615   /* signal the NMI */
616616   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));
618618
619619   if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", machine().primary_screen->vpos());
620620}
r18112r18113
640640 *
641641 *************************************/
642642
643static TIMER_CALLBACK( behind_the_beam_update );
644643
645644
645
646646MACHINE_START_MEMBER(itech8_state,sstrike)
647647{
648648   /* 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);
650650}
651651
652652void itech8_state::machine_reset()
r18112r18113
676676 *
677677 *************************************/
678678
679static TIMER_CALLBACK( behind_the_beam_update )
679TIMER_CALLBACK_MEMBER(itech8_state::behind_the_beam_update)
680680{
681681   int scanline = param >> 8;
682682   int interval = param & 0xff;
683683
684684   /* force a partial update to the current scanline */
685   machine.primary_screen->update_partial(scanline);
685   machine().primary_screen->update_partial(scanline);
686686
687687   /* advance by the interval, and wrap to 0 */
688688   scanline += interval;
689689   if (scanline >= 256) scanline = 0;
690690
691691   /* 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);
693693}
694694
695695
r18112r18113
779779 *
780780 *************************************/
781781
782static TIMER_CALLBACK( delayed_sound_data_w )
782TIMER_CALLBACK_MEMBER(itech8_state::delayed_sound_data_w)
783783{
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);
787786}
788787
789788
790789WRITE8_MEMBER(itech8_state::sound_data_w)
791790{
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);
793792}
794793
795794
r18112r18113
800799          ((data & 0x5d) << 1) |
801800          ((data & 0x20) >> 3) |
802801          ((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);
804803}
805804
806805
trunk/src/mame/drivers/m10.c
r18112r18113
504504}
505505
506506
507static TIMER_CALLBACK( interrupt_callback )
507TIMER_CALLBACK_MEMBER(m10_state::interrupt_callback)
508508{
509   m10_state *state = machine.driver_data<m10_state>();
510509   if (param == 0)
511510   {
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);
514513   }
515514   if (param == 1)
516515   {
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);
519518   }
520519   if (param == -1)
521      state->m_maincpu->set_input_line(0, CLEAR_LINE);
520      m_maincpu->set_input_line(0, CLEAR_LINE);
522521
523522}
524523
r18112r18113
526525INTERRUPT_GEN_MEMBER(m10_state::m11_interrupt)
527526{
528527   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);
530529}
531530
532531INTERRUPT_GEN_MEMBER(m10_state::m10_interrupt)
r18112r18113
538537INTERRUPT_GEN_MEMBER(m10_state::m15_interrupt)
539538{
540539   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);
542541}
543542
544543/*************************************
trunk/src/mame/drivers/taito_z.c
r18112r18113
10191019
10201020/* 68000 A */
10211021
1022static TIMER_CALLBACK( taitoz_interrupt6 )
1022TIMER_CALLBACK_MEMBER(taitoz_state::taitoz_interrupt6)
10231023{
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);
10261025}
10271026
10281027/* 68000 B */
10291028
1030static TIMER_CALLBACK( taitoz_cpub_interrupt5 )
1029TIMER_CALLBACK_MEMBER(taitoz_state::taitoz_cpub_interrupt5)
10311030{
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);
10341032}
10351033
10361034
r18112r18113
10451043   m_sci_int6 = !m_sci_int6;
10461044
10471045   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));
10491047
10501048   device.execute().set_input_line(4, HOLD_LINE);
10511049}
r18112r18113
12291227       but we don't want CPUA to have an int6 before int4 is over (?)
12301228    */
12311229
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));
12331231}
12341232
12351233
r18112r18113
12941292       Four lightgun interrupts happen before the collected coords
12951293       are moved to shared ram where CPUA can use them. */
12961294
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));
12981296}
12991297
13001298WRITE16_MEMBER(taitoz_state::spacegun_gun_output_w)
trunk/src/mame/drivers/msisaac.c
r18112r18113
2222*/
2323
2424
25static TIMER_CALLBACK( nmi_callback )
25TIMER_CALLBACK_MEMBER(msisaac_state::nmi_callback)
2626{
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);
3029   else
31      state->m_pending_nmi = 1;
30      m_pending_nmi = 1;
3231}
3332
3433WRITE8_MEMBER(msisaac_state::sound_command_w)
3534{
3635   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);
3837}
3938
4039WRITE8_MEMBER(msisaac_state::nmi_disable_w)
trunk/src/mame/drivers/psikyo.c
r18112r18113
144144}
145145
146146
147static TIMER_CALLBACK( psikyo_soundlatch_callback )
147TIMER_CALLBACK_MEMBER(psikyo_state::psikyo_soundlatch_callback)
148148{
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;
153152}
154153
155154WRITE32_MEMBER(psikyo_state::psikyo_soundlatch_w)
156155{
157156   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);
159158}
160159
161160/***************************************************************************
r18112r18113
165164WRITE32_MEMBER(psikyo_state::s1945_soundlatch_w)
166165{
167166   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);
169168}
170169
171170static const UINT8 s1945_table[256] = {
trunk/src/mame/drivers/equites.c
r18112r18113
395395
396396/******************************************************************************/
397397
398static TIMER_CALLBACK( equites_nmi_callback )
398TIMER_CALLBACK_MEMBER(equites_state::equites_nmi_callback)
399399{
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);
402401}
403402
404static TIMER_CALLBACK( equites_frq_adjuster_callback )
403TIMER_CALLBACK_MEMBER(equites_state::equites_frq_adjuster_callback)
405404{
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();
408406
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);
411409
412   state->m_cymvol *= 0.94f;
413   state->m_hihatvol *= 0.94f;
410   m_cymvol *= 0.94f;
411   m_hihatvol *= 0.94f;
414412
415   state->m_msm->set_output_gain(10, state->m_hihatvol + state->m_cymvol * (state->m_ay_port_b & 3) * 0.33);   /* NO from msm5232 */
413   m_msm->set_output_gain(10, m_hihatvol + m_cymvol * (m_ay_port_b & 3) * 0.33);   /* NO from msm5232 */
416414}
417415
418416static SOUND_START(equites)
419417{
420418   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));
422420
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));
424422   state->m_adjuster_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60));
425423}
426424
trunk/src/mame/drivers/model3.c
r18112r18113
12211221   ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x007fffff, FALSE, state->m_work_ram);
12221222}
12231223
1224static TIMER_CALLBACK(model3_sound_timer_tick)
1224TIMER_CALLBACK_MEMBER(model3_state::model3_sound_timer_tick)
12251225{
1226   model3_state *state = machine.driver_data<model3_state>();
12271226
1228   if (state->m_sound_irq_enable)
1227   if (m_sound_irq_enable)
12291228   {
1230      model3_set_irq_line(machine, 0x40, ASSERT_LINE);
1229      model3_set_irq_line(machine(), 0x40, ASSERT_LINE);
12311230   }
12321231}
12331232
r18112r18113
12351234{
12361235   configure_fast_ram(machine());
12371236
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));
12391238}
12401239MACHINE_START_MEMBER(model3_state,model3_15)
12411240{
12421241   configure_fast_ram(machine());
12431242
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));
12451244}
12461245MACHINE_START_MEMBER(model3_state,model3_20)
12471246{
12481247   configure_fast_ram(machine());
12491248
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));
12511250}
12521251MACHINE_START_MEMBER(model3_state,model3_21)
12531252{
12541253   configure_fast_ram(machine());
12551254
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));
12571256}
12581257
12591258static void model3_init(running_machine &machine, int step)
trunk/src/mame/drivers/mw8080bw.c
r18112r18113
873873}
874874
875875
876static TIMER_CALLBACK( maze_tone_timing_timer_callback )
876TIMER_CALLBACK_MEMBER(mw8080bw_state::maze_tone_timing_timer_callback)
877877{
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);
881880}
882881
883882
r18112r18113
885884{
886885
887886   /* 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));
889888
890889   /* initialize state of Tone Timing FF, IC C1 */
891890   m_maze_tone_timing_state = 0;
trunk/src/mame/drivers/firetrk.c
r18112r18113
5656}
5757
5858
59static TIMER_CALLBACK( periodic_callback )
59TIMER_CALLBACK_MEMBER(firetrk_state::periodic_callback)
6060{
6161   int scanline = param;
6262
63   generic_pulse_irq_line(machine.device("maincpu"), 0, 1);
63   generic_pulse_irq_line(machine().device("maincpu")->execute(), 0, 1);
6464
6565   /* IRQs are generated by inverse 16V signal */
6666   scanline += 32;
r18112r18113
6868   if (scanline > 262)
6969      scanline = 0;
7070
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);
7272}
7373
7474
r18112r18113
165165{
166166   set_service_mode(machine(), 0);
167167
168   machine().scheduler().synchronize(FUNC(periodic_callback));
168   machine().scheduler().synchronize(timer_expired_delegate(FUNC(firetrk_state::periodic_callback),this));
169169}
170170
171171
trunk/src/mame/drivers/gaelco3d.c
r18112r18113
361361 *
362362 *************************************/
363363
364static TIMER_CALLBACK( delayed_sound_w )
364TIMER_CALLBACK_MEMBER(gaelco3d_state::delayed_sound_w)
365365{
366   gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
367366   if (LOG)
368367      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);
371370}
372371
373372
r18112r18113
376375   if (LOG)
377376      logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", space.device().safe_pc(), offset, data, mem_mask);
378377   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);
380379}
381380
382381
trunk/src/mame/drivers/seta.c
r18112r18113
14011401/*------------------------------
14021402    callback
14031403------------------------------*/
1404static TIMER_CALLBACK( uPD71054_timer_callback )
1404TIMER_CALLBACK_MEMBER(seta_state::uPD71054_timer_callback)
14051405{
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 );
14081408}
14091409
14101410
r18112r18113
14241424      uPD71054->max[no] = 0xffff;
14251425   }
14261426   for( no = 0; no < USED_TIMER_NUM; no++ ) {
1427      uPD71054->timer[no] = machine.scheduler().timer_alloc( FUNC(uPD71054_timer_callback ));
1427      uPD71054->timer[no] = machine.scheduler().timer_alloc(timer_expired_delegate(FUNC(seta_state::uPD71054_timer_callback),state));
14281428   }
14291429}
14301430
r18112r18113
21402140   return result;
21412141}
21422142
2143static TIMER_CALLBACK( keroppi_prize_hop_callback )
2143TIMER_CALLBACK_MEMBER(seta_state::keroppi_prize_hop_callback)
21442144{
2145   seta_state *state = machine.driver_data<seta_state>();
2146   state->m_keroppi_prize_hop = 2;
2145   m_keroppi_prize_hop = 2;
21472146}
21482147
21492148WRITE16_MEMBER(seta_state::keroppi_prize_w)
r18112r18113
21512150   if ((data & 0x0010) && !m_keroppi_prize_hop)
21522151   {
21532152      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 */
21552154   }
21562155}
21572156
trunk/src/mame/drivers/namconb1.c
r18112r18113
296296}
297297
298298
299static TIMER_CALLBACK( namconb1_TriggerPOSIRQ )
299TIMER_CALLBACK_MEMBER(namconb1_state::namconb1_TriggerPOSIRQ)
300300{
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))
303302      return;
304303
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);
308307}
309308
310309INTERRUPT_GEN_MEMBER(namconb1_state::namconb1_interrupt)
r18112r18113
356355   }
357356   if( scanline < NAMCONB1_VBSTART )
358357   {
359      machine().scheduler().timer_set( machine().primary_screen->time_until_pos(scanline), FUNC(namconb1_TriggerPOSIRQ ), scanline);
358      machine().scheduler().timer_set( machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(namconb1_state::namconb1_TriggerPOSIRQ),this), scanline);
360359   }
361360} /* namconb1_interrupt */
362361
363362
364static TIMER_CALLBACK( namconb2_TriggerPOSIRQ )
363TIMER_CALLBACK_MEMBER(namconb1_state::namconb2_TriggerPOSIRQ)
365364{
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);
370368}
371369
372370INTERRUPT_GEN_MEMBER(namconb1_state::namconb2_interrupt)
r18112r18113
411409      scanline = 0;
412410
413411   if( scanline < NAMCONB1_VBSTART )
414      machine().scheduler().timer_set( machine().primary_screen->time_until_pos(scanline), FUNC(namconb2_TriggerPOSIRQ ), scanline);
412      machine().scheduler().timer_set( machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(namconb1_state::namconb2_TriggerPOSIRQ),this), scanline);
415413} /* namconb2_interrupt */
416414
417415static void namconb1_cpureg8_w(running_machine &machine, int reg, UINT8 data)
trunk/src/mame/drivers/cidelsa.c
r18112r18113
425425
426426/* Machine Start */
427427
428static TIMER_CALLBACK( set_cpu_mode )
428TIMER_CALLBACK_MEMBER(cidelsa_state::set_cpu_mode)
429429{
430   cidelsa_state *state = machine.driver_data<cidelsa_state>();
431430
432   state->m_reset = 1;
431   m_reset = 1;
433432}
434433
435434void cidelsa_state::machine_start()
r18112r18113
456455{
457456   /* reset the CPU */
458457   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));
460459}
461460
462461/* Machine Drivers */
trunk/src/mame/drivers/tehkanwc.c
r18112r18113
144144   machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
145145}
146146
147static TIMER_CALLBACK( reset_callback )
147TIMER_CALLBACK_MEMBER(tehkanwc_state::reset_callback)
148148{
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);
150150}
151151
152152WRITE8_MEMBER(tehkanwc_state::sound_answer_w)
r18112r18113
155155
156156   /* in Gridiron, the sound CPU goes in a tight loop after the self test, */
157157   /* 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));
159159}
160160
161161
trunk/src/mame/drivers/toaplan2.c
r18112r18113
484484***************************************************************************/
485485
486486
487static TIMER_CALLBACK( toaplan2_raise_irq )
487TIMER_CALLBACK_MEMBER(toaplan2_state::toaplan2_raise_irq)
488488{
489   toaplan2_state *state = machine.driver_data<toaplan2_state>();
490489
491   state->m_main_cpu->execute().set_input_line(param, HOLD_LINE);
490   m_main_cpu->execute().set_input_line(param, HOLD_LINE);
492491}
493492
494493static void toaplan2_vblank_irq(running_machine &machine, int irq_line)
495494{
495   toaplan2_state *state = machine.driver_data<toaplan2_state>();
496496   // 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);
498498}
499499
500500INTERRUPT_GEN_MEMBER(toaplan2_state::toaplan2_vblank_irq1){ toaplan2_vblank_irq(machine(), 1); }
trunk/src/mame/drivers/rollerg.c
r18112r18113
6161   m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
6262}
6363
64static TIMER_CALLBACK( nmi_callback )
64TIMER_CALLBACK_MEMBER(rollerg_state::nmi_callback)
6565{
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);
6867}
6968
7069WRITE8_MEMBER(rollerg_state::sound_arm_nmi_w)
7170{
7271   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 */
7473}
7574
7675READ8_MEMBER(rollerg_state::pip_r)
trunk/src/mame/drivers/magmax.c
r18112r18113
5858      m_LS74_q = 0;
5959}
6060
61static TIMER_CALLBACK( scanline_callback )
61TIMER_CALLBACK_MEMBER(magmax_state::scanline_callback)
6262{
63   magmax_state *state = machine.driver_data<magmax_state>();
6463   int scanline = param;
6564
6665   /* bit 0 goes hi whenever line V6 from video part goes lo->hi */
6766   /* 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;
7069
7170   scanline += 128;
7271   scanline &= 255;
7372
74   state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
73   m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
7574}
7675
7776void magmax_state::machine_start()
7877{
7978   /* 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));
8180
8281   /* Set up save state */
8382   state_save_register_global(machine(), m_sound_latch);
trunk/src/mame/machine/mhavoc.c
r18112r18113
120120 *
121121 *************************************/
122122
123static TIMER_CALLBACK( delayed_gamma_w )
123TIMER_CALLBACK_MEMBER(mhavoc_state::delayed_gamma_w)
124124{
125   mhavoc_state *state = machine.driver_data<mhavoc_state>();
126125   /* 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;
130129
131130   /* 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);
133132
134133   /* 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);
136135}
137136
138137
139138WRITE8_MEMBER(mhavoc_state::mhavoc_gamma_w)
140139{
141140   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);
143142}
144143
145144
trunk/src/mame/machine/arkanoid.c
r18112r18113
2323   return m_toz80;
2424}
2525
26static TIMER_CALLBACK( test )
26TIMER_CALLBACK_MEMBER(arkanoid_state::test)
2727{
28   arkanoid_state *state = machine.driver_data<arkanoid_state>();
2928
30   state->m_z80write = 1;
31   state->m_fromz80 = param;
29   m_z80write = 1;
30   m_fromz80 = param;
3231}
3332
3433WRITE8_MEMBER(arkanoid_state::arkanoid_Z80_mcu_w)
3534{
36   machine().scheduler().synchronize(FUNC(test), data);
35   machine().scheduler().synchronize(timer_expired_delegate(FUNC(arkanoid_state::test),this), data);
3736   /* boost the interleave for a few usecs to make sure it is read successfully */
3837   machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
3938}
trunk/src/mame/machine/micro3d.c
r18112r18113
258258   return result >> 14;
259259}
260260
261static TIMER_CALLBACK( mac_done_callback )
261TIMER_CALLBACK_MEMBER(micro3d_state::mac_done_callback)
262262{
263   micro3d_state *state = machine.driver_data<micro3d_state>();
264263
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;
267266}
268267
269268
r18112r18113
466465
467466   /* TODO: Calculate a better estimate for timing */
468467   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));
470469
471470   m_mrab11 = mrab11;
472471   m_vtx_addr = vtx_addr;
r18112r18113
497496   return ((y_encoder & 0xff) << 8) | (x_encoder & 0xff);
498497}
499498
500static TIMER_CALLBACK( adc_done_callback )
499TIMER_CALLBACK_MEMBER(micro3d_state::adc_done_callback)
501500{
502   micro3d_state *state = machine.driver_data<micro3d_state>();
503501
504502   switch (param)
505503   {
506      case 0: state->m_adc_val = state->ioport("THROTTLE")->read_safe(0);
504      case 0: m_adc_val = ioport("THROTTLE")->read_safe(0);
507505            break;
508      case 1: state->m_adc_val = (UINT8)((255.0/100.0) * state->ioport("VOLUME")->read() + 0.5);
506      case 1: m_adc_val = (UINT8)((255.0/100.0) * ioport("VOLUME")->read() + 0.5);
509507            break;
510508      case 2: break;
511509      case 3: break;
512510   }
513511
514//  mc68901_int_gen(machine, GPIP3);
512//  mc68901_int_gen(machine(), GPIP3);
515513}
516514
517515READ16_MEMBER(micro3d_state::micro3d_adc_r)
r18112r18113
528526      return;
529527   }
530528
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);
532530}
533531
534532CUSTOM_INPUT_MEMBER(micro3d_state::botss_hwchk_r)
trunk/src/mame/machine/lsasquad.c
r18112r18113
88
99***************************************************************************/
1010
11static TIMER_CALLBACK( nmi_callback )
11TIMER_CALLBACK_MEMBER(lsasquad_state::nmi_callback)
1212{
13   lsasquad_state *state = machine.driver_data<lsasquad_state>();
1413
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);
1716   else
18      state->m_pending_nmi = 1;
17      m_pending_nmi = 1;
1918}
2019
2120WRITE8_MEMBER(lsasquad_state::lsasquad_sh_nmi_disable_w)
r18112r18113
4039   m_sound_cmd = data;
4140
4241   //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);
4443}
4544
4645READ8_MEMBER(lsasquad_state::lsasquad_sh_sound_command_r)
trunk/src/mame/machine/williams.c
r18112r18113
268268}
269269
270270
271static TIMER_CALLBACK( williams_count240_off_callback )
271TIMER_CALLBACK_MEMBER(williams_state::williams_count240_off_callback)
272272{
273   pia6821_device *pia_1 = machine.device<pia6821_device>("pia_1");
273   pia6821_device *pia_1 = machine().device<pia6821_device>("pia_1");
274274
275275   /* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */
276276   pia_1->ca1_w(0);
r18112r18113
279279
280280TIMER_DEVICE_CALLBACK( williams_count240_callback )
281281{
282   williams_state *state = timer.machine().driver_data<williams_state>();
282283   pia6821_device *pia_1 = timer.machine().device<pia6821_device>("pia_1");
283284
284285   /* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */
285286   pia_1->ca1_w(1);
286287
287288   /* 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));
289290
290291   /* set a timer for next frame */
291292   timer.adjust(timer.machine().primary_screen->time_until_pos(240));
r18112r18113
422423}
423424
424425
425static TIMER_CALLBACK( williams2_endscreen_off_callback )
426TIMER_CALLBACK_MEMBER(williams_state::williams2_endscreen_off_callback)
426427{
427   pia6821_device *pia_0 = machine.device<pia6821_device>("pia_0");
428   pia6821_device *pia_0 = machine().device<pia6821_device>("pia_0");
428429
429430   /* the /ENDSCREEN signal comes into CA1 */
430431   pia_0->ca1_w(1);
r18112r18113
433434
434435TIMER_DEVICE_CALLBACK( williams2_endscreen_callback )
435436{
437   williams_state *state = timer.machine().driver_data<williams_state>();
436438   pia6821_device *pia_0 = timer.machine().device<pia6821_device>("pia_0");
437439
438440   /* the /ENDSCREEN signal comes into CA1 */
439441   pia_0->ca1_w(0);
440442
441443   /* 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));
443445
444446   /* set a timer for next frame */
445447   timer.adjust(timer.machine().primary_screen->time_until_pos(254));
r18112r18113
550552 *
551553 *************************************/
552554
553static TIMER_CALLBACK( williams_deferred_snd_cmd_w )
555TIMER_CALLBACK_MEMBER(williams_state::williams_deferred_snd_cmd_w)
554556{
555   pia6821_device *pia_2 = machine.device<pia6821_device>("pia_2");
557   pia6821_device *pia_2 = machine().device<pia6821_device>("pia_2");
556558
557559   pia_2->portb_w(param);
558560   pia_2->cb1_w((param == 0xff) ? 0 : 1);
r18112r18113
560562
561563WRITE8_DEVICE_HANDLER( williams_snd_cmd_w )
562564{
565   williams_state *state = device->machine().driver_data<williams_state>();
563566   /* 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);
565568}
566569
567570WRITE8_DEVICE_HANDLER( playball_snd_cmd_w )
568571{
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);
570574}
571575
572static TIMER_CALLBACK( blaster_deferred_snd_cmd_w )
576TIMER_CALLBACK_MEMBER(williams_state::blaster_deferred_snd_cmd_w)
573577{
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");
576580   UINT8 l_data = param | 0x80;
577581   UINT8 r_data = (param >> 1 & 0x40) | (param & 0x3f) | 0x80;
578582
r18112r18113
582586
583587WRITE8_DEVICE_HANDLER( blaster_snd_cmd_w )
584588{
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);
586591}
587592
588593
589static TIMER_CALLBACK( williams2_deferred_snd_cmd_w )
594TIMER_CALLBACK_MEMBER(williams_state::williams2_deferred_snd_cmd_w)
590595{
591   pia6821_device *pia_2 = machine.device<pia6821_device>("pia_2");
596   pia6821_device *pia_2 = machine().device<pia6821_device>("pia_2");
592597
593598   pia_2->porta_w(param);
594599}
595600
596601static WRITE8_DEVICE_HANDLER( williams2_snd_cmd_w )
597602{
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);
599605}
600606
601607
r18112r18113
991997}
992998
993999
994static TIMER_CALLBACK( joust2_deferred_snd_cmd_w )
1000TIMER_CALLBACK_MEMBER(joust2_state::joust2_deferred_snd_cmd_w)
9951001{
996   pia6821_device *pia_2 = machine.device<pia6821_device>("pia_2");
1002   pia6821_device *pia_2 = machine().device<pia6821_device>("pia_2");
9971003   pia_2->porta_w(param & 0xff);
9981004}
9991005
r18112r18113
10111017   joust2_state *state = space.machine().driver_data<joust2_state>();
10121018   state->m_joust2_current_sound_data = (state->m_joust2_current_sound_data & ~0xff) | (data & 0xff);
10131019   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);
10151021}
trunk/src/mame/machine/dc.c
r18112r18113
7676
7777#endif
7878
79static TIMER_CALLBACK( aica_dma_irq )
79TIMER_CALLBACK_MEMBER(dc_state::aica_dma_irq)
8080{
81   dc_state *state = machine.driver_data<dc_state>();
8281
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());
8685}
8786
88static TIMER_CALLBACK( pvr_dma_irq )
87TIMER_CALLBACK_MEMBER(dc_state::pvr_dma_irq)
8988{
90   dc_state *state = machine.driver_data<dc_state>();
9189
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());
9593}
9694
9795void naomi_g1_irq(running_machine &machine)
r18112r18113
110108   dc_update_interrupt_status(machine);
111109}
112110
113static TIMER_CALLBACK( ch2_dma_irq )
111TIMER_CALLBACK_MEMBER(dc_state::ch2_dma_irq)
114112{
115   dc_state *state = machine.driver_data<dc_state>();
116113
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());
121118}
122119
123static TIMER_CALLBACK( yuv_fifo_irq )
120TIMER_CALLBACK_MEMBER(dc_state::yuv_fifo_irq)
124121{
125   dc_state *state = machine.driver_data<dc_state>();
126122
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());
129125}
130126
131127static void wave_dma_execute(address_space &space)
r18112r18113
166162   state->m_wave_dma.flag = (state->m_wave_dma.indirect & 1) ? 1 : 0;
167163   /* Note: if you trigger an instant DMA IRQ trigger, sfz3upper doesn't play any bgm. */
168164   /* 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));
170166}
171167
172168static void pvr_dma_execute(address_space &space)
r18112r18113
206202   }
207203   /* Note: do not update the params, since this DMA type doesn't support it. */
208204   /* 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));
210206}
211207
212208// register decode helpers
r18112r18113
419415               state->dc_sysctrl_regs[SB_C2DSTAT]=address+ddtdata.length;
420416
421417            /* 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));
423419            /* simulate YUV FIFO processing here */
424420            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));
426422         }
427423         break;
428424
r18112r18113
737733   mame_printf_verbose("RTC: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x710000 + reg*4, dat, data, offset, mem_mask);
738734}
739735
740static TIMER_CALLBACK(dc_rtc_increment)
736TIMER_CALLBACK_MEMBER(dc_state::dc_rtc_increment)
741737{
742   dc_state *state = machine.driver_data<dc_state>();
743738
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;
747742}
748743
749744/* fill the RTC registers with the proper start-up values */
r18112r18113
784779   state->dc_rtcregister[RTC2] = current_time & 0x0000ffff;
785780   state->dc_rtcregister[RTC1] = (current_time & 0xffff0000) >> 16;
786781
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));
788783}
789784
790785void dc_state::machine_start()
trunk/src/mame/machine/starwars.c
r18112r18113
3535
3636
3737
38static TIMER_CALLBACK( math_run_clear )
38TIMER_CALLBACK_MEMBER(starwars_state::math_run_clear)
3939{
40   starwars_state *state = machine.driver_data<starwars_state>();
41   state->m_math_run = 0;
40   m_math_run = 0;
4241}
4342
4443
r18112r18113
174173      state->m_PROM_AM[cnt]  = (val >> 7) & 0x0001;
175174   }
176175
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));
178177}
179178
180179
trunk/src/mame/machine/vectrex.c
r18112r18113
272272
273273*********************************************************************/
274274
275static TIMER_CALLBACK(vectrex_imager_change_color)
275TIMER_CALLBACK_MEMBER(vectrex_state::vectrex_imager_change_color)
276276{
277   vectrex_state *state = machine.driver_data<vectrex_state>();
278   state->m_beam_color = param;
277   m_beam_color = param;
279278}
280279
281280
282static TIMER_CALLBACK(update_level)
281TIMER_CALLBACK_MEMBER(vectrex_state::update_level)
283282{
284283   if (ptr)
285284      * (UINT8 *) ptr = param;
286285}
287286
288287
289TIMER_CALLBACK(vectrex_imager_eye)
288TIMER_CALLBACK_MEMBER(vectrex_state::vectrex_imager_eye)
290289{
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");
293291   int coffset;
294   double rtime = (1.0 / state->m_imager_freq);
292   double rtime = (1.0 / m_imager_freq);
295293
296   if (state->m_imager_status > 0)
294   if (m_imager_status > 0)
297295   {
298      state->m_imager_status = param;
296      m_imager_status = param;
299297      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]);
303301
304302      if (param == 2)
305303      {
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);
307305
308306         /* Index hole sensor is connected to IO7 which triggers also CA1 of VIA */
309307         via_0->write_ca1(1);
310308         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);
313311      }
314312   }
315313}
trunk/src/mame/machine/bublbobl.c
r18112r18113
8686}
8787
8888
89static TIMER_CALLBACK( nmi_callback )
89TIMER_CALLBACK_MEMBER(bublbobl_state::nmi_callback)
9090{
91   bublbobl_state *state = machine.driver_data<bublbobl_state>();
9291
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);
9594   else
96      state->m_pending_nmi = 1;
95      m_pending_nmi = 1;
9796}
9897
9998WRITE8_MEMBER(bublbobl_state::bublbobl_sound_command_w)
10099{
101100   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);
103102}
104103
105104WRITE8_MEMBER(bublbobl_state::bublbobl_sh_nmi_disable_w)
r18112r18113
367366 The following is ENTIRELY GUESSWORK!!!
368367
369368***************************************************************************/
370static TIMER_CALLBACK( bublbobl_m68705_irq_ack )
369TIMER_CALLBACK_MEMBER(bublbobl_state::bublbobl_m68705_irq_ack)
371370{
372   machine.device("mcu")->execute().set_input_line(0, CLEAR_LINE);
371   machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE);
373372}
374373
375374INTERRUPT_GEN_MEMBER(bublbobl_state::bublbobl_m68705_interrupt)
376375{
377376   device.execute().set_input_line(0, ASSERT_LINE);
378377
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 */
380379}
381380
382381
trunk/src/mame/machine/pitnrun.c
r18112r18113
1919   machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE);
2020}
2121
22static TIMER_CALLBACK( pitnrun_mcu_real_data_r )
22TIMER_CALLBACK_MEMBER(pitnrun_state::pitnrun_mcu_real_data_r)
2323{
24   pitnrun_state *state = machine.driver_data<pitnrun_state>();
25   state->m_zaccept = 1;
24   m_zaccept = 1;
2625}
2726
2827READ8_MEMBER(pitnrun_state::pitnrun_mcu_data_r)
2928{
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));
3130   return m_toz80;
3231}
3332
34static TIMER_CALLBACK( pitnrun_mcu_real_data_w )
33TIMER_CALLBACK_MEMBER(pitnrun_state::pitnrun_mcu_real_data_w)
3534{
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;
4038}
4139
4240WRITE8_MEMBER(pitnrun_state::pitnrun_mcu_data_w)
4341{
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);
4543   machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(5));
4644}
4745
r18112r18113
9088}
9189
9290
93static TIMER_CALLBACK( pitnrun_mcu_data_real_r )
91TIMER_CALLBACK_MEMBER(pitnrun_state::pitnrun_mcu_data_real_r)
9492{
95   pitnrun_state *state = machine.driver_data<pitnrun_state>();
96   state->m_zready = 0;
93   m_zready = 0;
9794}
9895
99static TIMER_CALLBACK( pitnrun_mcu_status_real_w )
96TIMER_CALLBACK_MEMBER(pitnrun_state::pitnrun_mcu_status_real_w)
10097{
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;
104100}
105101
106102WRITE8_MEMBER(pitnrun_state::pitnrun_68705_portB_w)
r18112r18113
109105   if (~data & 0x02)
110106   {
111107      /* 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));
113109      machine().device("mcu")->execute().set_input_line(0,CLEAR_LINE);
114110      m_portA_in = m_fromz80;
115111   }
116112   if (~data & 0x04)
117113   {
118114      /* 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);
120116   }
121117   if (~data & 0x10)
122118   {
trunk/src/mame/machine/stfight.c
r18112r18113
109109 *      CPU 1 timed interrupt - 60Hz???
110110 */
111111
112static TIMER_CALLBACK( stfight_interrupt_1 )
112TIMER_CALLBACK_MEMBER(stfight_state::stfight_interrupt_1)
113113{
114114    // 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);
116116}
117117
118118INTERRUPT_GEN_MEMBER(stfight_state::stfight_vb_interrupt)
119119{
120120    // Do a RST10
121121    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));
123123}
124124
125125/*
trunk/src/mame/machine/balsente.c
r18112r18113
2828 *
2929 *************************************/
3030
31static TIMER_CALLBACK( irq_off )
31TIMER_CALLBACK_MEMBER(balsente_state::irq_off)
3232{
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);
3434}
3535
3636
r18112r18113
4848   timer.machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE);
4949
5050   /* 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));
5252
5353   /* if this is Grudge Match, update the steering */
5454   if (state->m_grudge_steering_result & 0x80)
r18112r18113
456456}
457457
458458
459static TIMER_CALLBACK( m6850_data_ready_callback )
459TIMER_CALLBACK_MEMBER(balsente_state::m6850_data_ready_callback)
460460{
461   balsente_state *state = machine.driver_data<balsente_state>();
462461
463462   /* 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());
467466}
468467
469468
470static TIMER_CALLBACK( m6850_w_callback )
469TIMER_CALLBACK_MEMBER(balsente_state::m6850_w_callback)
471470{
472   balsente_state *state = machine.driver_data<balsente_state>();
473471
474472   /* 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());
477475
478476   /* set a timer for 500usec later to actually transmit the data */
479477   /* (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);
481479}
482480
483481
r18112r18113
495493
496494   /* output register is at offset 1; set a timer to synchronize the CPUs */
497495   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);
499497}
500498
501499
r18112r18113
570568}
571569
572570
573static TIMER_CALLBACK( adc_finished )
571TIMER_CALLBACK_MEMBER(balsente_state::adc_finished)
574572{
575   balsente_state *state = machine.driver_data<balsente_state>();
576573   int which = param;
577574
578575   /* analog controls are read in two pieces; the lower port returns the sign */
579576   /* and the upper port returns the absolute value of the magnitude */
580   int val = state->m_analog_input_data[which / 2] << state->m_adc_shift;
577   int val = m_analog_input_data[which / 2] << m_adc_shift;
581578
582579   /* special case for Stompin'/Shrike Avenger */
583   if (state->m_adc_shift == 32)
580   if (m_adc_shift == 32)
584581   {
585      state->m_adc_value = state->m_analog_input_data[which];
582      m_adc_value = m_analog_input_data[which];
586583      return;
587584   }
588585
r18112r18113
597594
598595   /* return the sign */
599596   if (!(which & 1))
600      state->m_adc_value = (val < 0) ? 0xff : 0x00;
597      m_adc_value = (val < 0) ? 0xff : 0x00;
601598
602599   /* return the magnitude */
603600   else
604      state->m_adc_value = (val < 0) ? -val : val;
601      m_adc_value = (val < 0) ? -val : val;
605602}
606603
607604
r18112r18113
618615   /* set a timer to go off and read the value after 50us */
619616   /* it's important that we do this for Mini Golf */
620617logerror("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);
622619}
623620
624621
trunk/src/mame/machine/snes.c
r18112r18113
101101
102102*************************************/
103103
104static TIMER_CALLBACK( snes_nmi_tick )
104TIMER_CALLBACK_MEMBER(snes_state::snes_nmi_tick)
105105{
106   snes_state *state = machine.driver_data<snes_state>();
107106
108107   // pull NMI
109   state->m_maincpu->set_input_line(G65816_LINE_NMI, ASSERT_LINE);
108   m_maincpu->set_input_line(G65816_LINE_NMI, ASSERT_LINE);
110109
111110   // don't happen again
112   state->m_nmi_timer->adjust(attotime::never);
111   m_nmi_timer->adjust(attotime::never);
113112}
114113
115114static void snes_hirq_tick( running_machine &machine )
r18112r18113
126125   state->m_hirq_timer->adjust(attotime::never);
127126}
128127
129static TIMER_CALLBACK( snes_hirq_tick_callback )
128TIMER_CALLBACK_MEMBER(snes_state::snes_hirq_tick_callback)
130129{
131   snes_hirq_tick(machine);
130   snes_hirq_tick(machine());
132131}
133132
134static TIMER_CALLBACK( snes_reset_oam_address )
133TIMER_CALLBACK_MEMBER(snes_state::snes_reset_oam_address)
135134{
136   snes_state *state = machine.driver_data<snes_state>();
137135   // make sure we're in the 65816's context since we're messing with the OAM and stuff
138   address_space &space = state->m_maincpu->space(AS_PROGRAM);
136   address_space &space = m_maincpu->space(AS_PROGRAM);
139137
140138   if (!(snes_ppu.screen_disabled)) //Reset OAM address, byuu says it happens at H=10
141139   {
r18112r18113
145143   }
146144}
147145
148static TIMER_CALLBACK( snes_reset_hdma )
146TIMER_CALLBACK_MEMBER(snes_state::snes_reset_hdma)
149147{
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);
152149   snes_hdma_init(cpu0space);
153150}
154151
155static TIMER_CALLBACK( snes_update_io )
152TIMER_CALLBACK_MEMBER(snes_state::snes_update_io)
156153{
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());
160156   snes_ram[HVBJOY] &= 0xfe;      /* Clear busy bit */
161157
162   state->m_io_timer->adjust(attotime::never);
158   m_io_timer->adjust(attotime::never);
163159}
164160
165static TIMER_CALLBACK( snes_scanline_tick )
161TIMER_CALLBACK_MEMBER(snes_state::snes_scanline_tick)
166162{
167   snes_state *state = machine.driver_data<snes_state>();
168163
169164   /* 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();
171166
172167   // not in hblank
173168   snes_ram[HVBJOY] &= ~0x40;
r18112r18113
175170   /* Vertical IRQ timer - only if horizontal isn't also enabled! */
176171   if ((snes_ram[NMITIMEN] & 0x20) && !(snes_ram[NMITIMEN] & 0x10))
177172   {
178      if (snes_ppu.beam.current_vert == state->m_vtime)
173      if (snes_ppu.beam.current_vert == m_vtime)
179174      {
180175         snes_ram[TIMEUP] = 0x80;   /* Indicate that irq occurred */
181176         // 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 );
184179      }
185180   }
186181   /* Horizontal IRQ timer */
187182   if (snes_ram[NMITIMEN] & 0x10)
188183   {
189184      int setirq = 1;
190      int pixel = state->m_htime;
185      int pixel = m_htime;
191186
192187      // is the HIRQ on a specific scanline?
193188      if (snes_ram[NMITIMEN] & 0x20)
194189      {
195         if (snes_ppu.beam.current_vert != state->m_vtime)
190         if (snes_ppu.beam.current_vert != m_vtime)
196191         {
197192            setirq = 0;
198193         }
r18112r18113
200195
201196      if (setirq)
202197      {
203//          printf("HIRQ @ %d, %d\n", pixel * state->m_htmult, snes_ppu.beam.current_vert);
198//          printf("HIRQ @ %d, %d\n", pixel * m_htmult, snes_ppu.beam.current_vert);
204199         if (pixel == 0)
205200         {
206            snes_hirq_tick(machine);
201            snes_hirq_tick(machine());
207202         }
208203         else
209204         {
210            state->m_hirq_timer->adjust(machine.primary_screen->time_until_pos(snes_ppu.beam.current_vert, pixel * state->m_htmult));
205            m_hirq_timer->adjust(machine().primary_screen->time_until_pos(snes_ppu.beam.current_vert, pixel * m_htmult));
211206         }
212207      }
213208   }
r18112r18113
215210   /* Start of VBlank */
216211   if (snes_ppu.beam.current_vert == snes_ppu.beam.last_visible_line)
217212   {
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));
219214
220215      snes_ram[HVBJOY] |= 0x81;      /* Set vblank bit to on & indicate controllers being read */
221216      snes_ram[RDNMI] |= 0x80;      /* Set NMI occurred bit */
r18112r18113
223218      if (snes_ram[NMITIMEN] & 0x80)   /* NMI only signaled if this bit set */
224219      {
225220         // NMI goes off about 12 cycles after this (otherwise Chrono Trigger, NFL QB Club, etc. lock up)
226         state->m_nmi_timer->adjust(state->m_maincpu->cycles_to_attotime(12));
221         m_nmi_timer->adjust(m_maincpu->cycles_to_attotime(12));
227222      }
228223
229224      /* three lines after start of vblank we update the controllers (value from snes9x) */
230      state->m_io_timer->adjust(machine.primary_screen->time_until_pos(snes_ppu.beam.current_vert + 2, state->m_hblank_offset * state->m_htmult));
225      m_io_timer->adjust(machine().primary_screen->time_until_pos(snes_ppu.beam.current_vert + 2, m_hblank_offset * m_htmult));
231226   }
232227
233228   // hdma reset happens at scanline 0, H=~6
234229   if (snes_ppu.beam.current_vert == 0)
235230   {
236      address_space &cpu0space = state->m_maincpu->space(AS_PROGRAM);
231      address_space &cpu0space = m_maincpu->space(AS_PROGRAM);
237232      snes_hdma_init(cpu0space);
238233   }
239234
r18112r18113
244239      snes_ram[STAT78] ^= 0x80;      /* Toggle field flag */
245240      snes_ppu.stat77_flags &= 0x3f;   /* Clear Time Over and Range Over bits */
246241
247      state->m_maincpu->set_input_line(G65816_LINE_NMI, CLEAR_LINE );
242      m_maincpu->set_input_line(G65816_LINE_NMI, CLEAR_LINE );
248243   }
249244
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));
252247
253248//  printf("%02x %d\n",snes_ram[HVBJOY],snes_ppu.beam.current_vert);
254249}
255250
256251/* This is called at the start of hblank *before* the scanline indicated in current_vert! */
257static TIMER_CALLBACK( snes_hblank_tick )
252TIMER_CALLBACK_MEMBER(snes_state::snes_hblank_tick)
258253{
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);
261255   int nextscan;
262256
263   snes_ppu.beam.current_vert = machine.primary_screen->vpos();
257   snes_ppu.beam.current_vert = machine().primary_screen->vpos();
264258
265259   /* make sure we halt */
266   state->m_hblank_timer->adjust(attotime::never);
260   m_hblank_timer->adjust(attotime::never);
267261
268262   /* draw a scanline */
269263   if (snes_ppu.beam.current_vert <= snes_ppu.beam.last_visible_line)
270264   {
271      if (machine.primary_screen->vpos() > 0)
265      if (machine().primary_screen->vpos() > 0)
272266      {
273267         /* Do HDMA */
274268         if (snes_ram[HDMAEN])
275269            snes_hdma(cpu0space);
276270
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);
278272      }
279273   }
280274
r18112r18113
288282      nextscan = 0;
289283   }
290284
291   state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(nextscan));
285   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(nextscan));
292286}
293287
294288
r18112r18113
723717         break;
724718      case HDMAEN:   /* HDMA channel designation */
725719         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));
727721         break;
728722      case TIMEUP:   // IRQ Flag is cleared on both read and write
729723         state->m_maincpu->set_input_line(G65816_LINE_IRQ, CLEAR_LINE );
r18112r18113
15341528   snes_state *state = machine.driver_data<snes_state>();
15351529
15361530   /* 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));
15381532   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));
15401534   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));
15421536   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));
15441538   state->m_hirq_timer->adjust(attotime::never);
15451539   //state->m_div_timer = machine.scheduler().timer_alloc(FUNC(snes_div_callback));
15461540   //state->m_div_timer->adjust(attotime::never);
15471541   //state->m_mult_timer = machine.scheduler().timer_alloc(FUNC(snes_mult_callback));
15481542   //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));
15501544   state->m_io_timer->adjust(attotime::never);
15511545
15521546   // SNES hcounter has a 0-339 range.  hblank starts at counter 260.
trunk/src/mame/machine/irobot.c
r18112r18113
150150   set_led_status(machine(), 1,data & 0x20);
151151}
152152
153static TIMER_CALLBACK( scanline_callback )
153TIMER_CALLBACK_MEMBER(irobot_state::scanline_callback)
154154{
155   irobot_state *state = machine.driver_data<irobot_state>();
156155   int scanline = param;
157156
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;
160159    logerror("SCANLINE CALLBACK %d\n",scanline);
161160    /* 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);
163162
164163    /* set a callback for the next 32-scanline increment */
165164    scanline += 32;
166165    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);
168167}
169168
170169void irobot_state::machine_reset()
r18112r18113
184183   m_irmb_timer = machine().device<timer_device>("irmb_timer");
185184
186185   /* 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));
188187
189188   irobot_rom_banksel_w(machine().device("maincpu")->memory().space(AS_PROGRAM),0,0);
190189   irobot_out0_w(machine().device("maincpu")->memory().space(AS_PROGRAM),0,0);
trunk/src/mame/machine/leland.c
r18112r18113
3333
3434
3535/* Internal routines */
36static TIMER_CALLBACK( leland_interrupt_callback );
37static TIMER_CALLBACK( ataxx_interrupt_callback );
3836
3937
4038
39
40
4141/*************************************
4242 *
4343 *  Generic dial encoding
r18112r18113
322322   m_battery_ram = reinterpret_cast<UINT8 *>(memshare("battery")->ptr());
323323
324324   /* 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));
326326}
327327
328328
r18112r18113
372372   m_extra_tram = auto_alloc_array(machine(), UINT8, ATAXX_EXTRA_TRAM_SIZE);
373373
374374   /* 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));
376376}
377377
378378
r18112r18113
416416 *
417417 *************************************/
418418
419static TIMER_CALLBACK( leland_interrupt_callback )
419TIMER_CALLBACK_MEMBER(leland_state::leland_interrupt_callback)
420420{
421   leland_state *state = machine.driver_data<leland_state>();
422421   int scanline = param;
423422
424423   /* interrupts generated on the VA10 line, which is every */
425424   /* 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);
427426
428427   /* set a timer for the next one */
429428   scanline += 16;
430429   if (scanline > 248)
431430      scanline = 8;
432   state->m_master_int_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
431   m_master_int_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
433432}
434433
435434
436static TIMER_CALLBACK( ataxx_interrupt_callback )
435TIMER_CALLBACK_MEMBER(leland_state::ataxx_interrupt_callback)
437436{
438   leland_state *state = machine.driver_data<leland_state>();
439437   int scanline = param;
440438
441439   /* 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);
443441
444442   /* set a timer for the next one */
445   state->m_master_int_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
443   m_master_int_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
446444}
447445
448446
trunk/src/mame/machine/rainbow.c
r18112r18113
731731   state->m_CRAM[1][0x154] = cchip_goalin[n][5];
732732}
733733
734static TIMER_CALLBACK( cchip_timer )
734TIMER_CALLBACK_MEMBER(rbisland_state::cchip_timer)
735735{
736   rbisland_state *state = machine.driver_data<rbisland_state>();
737736
738   if (state->m_CRAM[1][0x100] == 1)
737   if (m_CRAM[1][0x100] == 1)
739738   {
740      request_round_data(machine);
739      request_round_data(machine());
741740
742      state->m_CRAM[1][0x100] = 0xFF;
741      m_CRAM[1][0x100] = 0xFF;
743742   }
744743
745   if (state->m_CRAM[5][0x000] == 1)
744   if (m_CRAM[5][0x000] == 1)
746745   {
747      request_world_data(machine);
746      request_world_data(machine());
748747
749      state->m_CRAM[5][0x000] = 0xFF;
748      m_CRAM[5][0x000] = 0xFF;
750749   }
751750
752   if (state->m_CRAM[1][0x149] == 1)
751   if (m_CRAM[1][0x149] == 1)
753752   {
754      request_goalin_data(machine);
753      request_goalin_data(machine());
755754
756      state->m_CRAM[1][0x149] = 0xFF;
755      m_CRAM[1][0x149] = 0xFF;
757756   }
758757
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);
763762
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) */
768767}
769768
770769/*************************************
r18112r18113
830829
831830   state_save_register_item(machine, "cchip", NULL, 0, state->m_current_bank);
832831
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));
834833}
trunk/src/mame/machine/harddriv.c
r18112r18113
632632 *
633633 *************************************/
634634
635static TIMER_CALLBACK( deferred_adsp_bank_switch )
635TIMER_CALLBACK_MEMBER(harddriv_state::deferred_adsp_bank_switch)
636636{
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))
639638   {
640639      static FILE *commands;
641640      if (!commands) commands = fopen("commands.log", "w");
642641      if (commands)
643642      {
644         INT16 *base = (INT16 *)&state->m_som_memory[param * 0x2000];
643         INT16 *base = (INT16 *)&m_som_memory[param * 0x2000];
645644         INT16 *end = base + (UINT16)*base;
646645         INT16 *current = base + 1;
647646         INT16 *table = base + 1 + (UINT16)*current++;
r18112r18113
679678      }
680679   }
681680
682   state->m_m68k_adsp_buffer_bank = param;
681   m_m68k_adsp_buffer_bank = param;
683682   logerror("ADSP bank = %d\n", param);
684683}
685684
r18112r18113
702701
703702      case 3:
704703         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);
706705         break;
707706
708707      case 5:
r18112r18113
13081307 *
13091308 *************************************/
13101309
1311static TIMER_CALLBACK( rddsp32_sync_cb )
1310TIMER_CALLBACK_MEMBER(harddriv_state::rddsp32_sync_cb)
13121311{
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];
13151313}
13161314
13171315
r18112r18113
13251323      COMBINE_DATA(&newdata);
13261324      state->m_dataptr[state->m_next_msp_sync % MAX_MSP_SYNC] = dptr;
13271325      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);
13291327   }
13301328   else
13311329      COMBINE_DATA(&state->m_rddsp32_sync[0][offset]);
r18112r18113
13421340      COMBINE_DATA(&newdata);
13431341      state->m_dataptr[state->m_next_msp_sync % MAX_MSP_SYNC] = dptr;
13441342      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);
13461344   }
13471345   else
13481346      COMBINE_DATA(&state->m_rddsp32_sync[1][offset]);
trunk/src/mame/machine/amiga.c
r18112r18113
140140
141141static void custom_reset(running_machine &machine);
142142static void autoconfig_reset(running_machine &machine);
143static TIMER_CALLBACK( amiga_irq_proc );
144static TIMER_CALLBACK( amiga_blitter_proc );
145static TIMER_CALLBACK( scanline_callback );
146143
147144
148145
146
147
148
149149/*************************************
150150 *
151151 *  Chipmem 16/32 bit access
r18112r18113
251251   }
252252
253253   /* 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));
256256
257257   state->m_sound_device = machine.device("amiga");
258258}
r18112r18113
296296      (*m_intf->reset_callback)(machine());
297297
298298   /* 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));
300300}
301301
302302
r18112r18113
307307 *
308308 *************************************/
309309
310static TIMER_CALLBACK( scanline_callback )
310TIMER_CALLBACK_MEMBER(amiga_state::scanline_callback)
311311{
312   amiga_state *state = machine.driver_data<amiga_state>();
312
313313   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");
316316
317317   /* on the first scanline, we do some extra bookkeeping */
318318   if (scanline == 0)
319319   {
320320      /* 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);
322322
323323      /* clock the first CIA TOD */
324324      mos6526_tod_w(cia_0, 1);
325325
326326      /* 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());
329329   }
330330
331331   /* on every scanline, clock the second CIA TOD */
332332   mos6526_tod_w(cia_1, 1);
333333
334334   /* render up to this scanline */
335   if (!machine.primary_screen->update_partial(scanline))
335   if (!machine().primary_screen->update_partial(scanline))
336336   {
337      if (IS_AGA(state->m_intf))
337      if (IS_AGA(m_intf))
338338      {
339339         bitmap_rgb32 dummy_bitmap;
340         amiga_aga_render_scanline(machine, dummy_bitmap, scanline);
340         amiga_aga_render_scanline(machine(), dummy_bitmap, scanline);
341341      }
342342      else
343343      {
344344         bitmap_ind16 dummy_bitmap;
345         amiga_render_scanline(machine, dummy_bitmap, scanline);
345         amiga_render_scanline(machine(), dummy_bitmap, scanline);
346346      }
347347   }
348348
349349   /* force a sound update */
350   amiga_audio_update(state->m_sound_device);
350   amiga_audio_update(m_sound_device);
351351
352352   /* 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);
355355}
356356
357357
r18112r18113
400400}
401401
402402
403static TIMER_CALLBACK( amiga_irq_proc )
403TIMER_CALLBACK_MEMBER(amiga_state::amiga_irq_proc)
404404{
405   amiga_state *state = machine.driver_data<amiga_state>();
406405
407   update_irqs(machine);
408   state->m_irq_timer->reset( );
406   update_irqs(machine());
407   m_irq_timer->reset( );
409408}
410409
411410
r18112r18113
891890 *
892891 *************************************/
893892
894static TIMER_CALLBACK( amiga_blitter_proc )
893TIMER_CALLBACK_MEMBER(amiga_state::amiga_blitter_proc)
895894{
896   amiga_state *state = machine.driver_data<amiga_state>();
895   amiga_state *state = machine().driver_data<amiga_state>();
897896   UINT32 blitsum = 0;
898897
899898   /* logging */
r18112r18113
918917   switch (CUSTOM_REG(REG_BLTCON1) & 0x0003)
919918   {
920919      case 0:   /* ascending */
921         blitsum = blit_ascending(state);
920         blitsum = blit_ascending(this);
922921         break;
923922
924923      case 2:   /* descending */
925         blitsum = blit_descending(state);
924         blitsum = blit_descending(this);
926925         break;
927926
928927      case 1:   /* line */
929928      case 3:
930         blitsum = blit_line(state);
929         blitsum = blit_line(this);
931930         break;
932931   }
933932
r18112r18113
939938   CUSTOM_REG(REG_DMACON) &= ~0x4000;
940939
941940   /* 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);
943942
944943   /* reset the blitter timer */
945   state->m_blitter_timer->reset( );
944   m_blitter_timer->reset( );
946945}
947946
948947
r18112r18113
12411240 *
12421241 *************************************/
12431242
1244static TIMER_CALLBACK( finish_serial_write )
1243TIMER_CALLBACK_MEMBER(amiga_state::finish_serial_write)
12451244{
1246   amiga_state *state = machine.driver_data<amiga_state>();
1245   amiga_state *state = machine().driver_data<amiga_state>();
12471246
12481247   /* mark the transfer buffer empty */
12491248   CUSTOM_REG(REG_SERDATR) |= 0x3000;
12501249
12511250   /* 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);
12531252}
12541253
12551254
r18112r18113
12981297         if (state->m_intf->serdat_w != NULL)
12991298            (*state->m_intf->serdat_w)(space.machine(), data);
13001299         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));
13021301         break;
13031302
13041303      case REG_BLTSIZE:
trunk/src/mame/machine/mw8080bw.c
r18112r18113
4242}
4343
4444
45static TIMER_CALLBACK( mw8080bw_interrupt_callback )
45TIMER_CALLBACK_MEMBER(mw8080bw_state::mw8080bw_interrupt_callback)
4646{
47   mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
4847   UINT8 next_counter;
4948   int next_vpos;
5049   int next_vblank;
5150
5251   /* compute vector and set the interrupt line */
53   int vpos = machine.primary_screen->vpos();
52   int vpos = machine().primary_screen->vpos();
5453   UINT8 counter = vpos_to_vysnc_chain_counter(vpos);
5554   UINT8 vector = 0xc7 | ((counter & 0x40) >> 2) | ((~counter & 0x40) >> 3);
56   state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, vector);
55   m_maincpu->set_input_line_and_vector(0, HOLD_LINE, vector);
5756
5857   /* set up for next interrupt */
5958   if (counter == MW8080BW_INT_TRIGGER_COUNT_1)
r18112r18113
6867   }
6968
7069   next_vpos = vysnc_chain_counter_to_vpos(next_counter, next_vblank);
71   state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(next_vpos));
70   m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(next_vpos));
7271}
7372
7473
7574static void mw8080bw_create_interrupt_timer( running_machine &machine )
7675{
7776   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));
7978}
8079
8180
trunk/src/mame/machine/tnzs.c
r18112r18113
495495*********************************/
496496
497497/*
498static TIMER_CALLBACK( kludge_callback )
498TIMER_CALLBACK_MEMBER(tnzs_state::kludge_callback)
499499{
500500    tnzs_sharedram[0x0f10] = param;
501501}
502502
503503WRITE8_MEMBER(tnzs_state::tnzs_sync_kludge_w)
504504{
505    machine().scheduler().synchronize(FUNC(kludge_callback), data);
505    machine().scheduler().synchronize(timer_expired_delegate(FUNC(tnzs_state::kludge_callback),this), data);
506506}
507507*/
508508
trunk/src/mame/machine/mcr68.c
r18112r18113
2121
2222static void subtract_from_counter(running_machine &machine, int counter, int count);
2323
24static TIMER_CALLBACK( mcr68_493_callback );
25static TIMER_CALLBACK( zwackery_493_callback );
2624
25
26
2727static DECLARE_WRITE8_DEVICE_HANDLER( zwackery_pia0_w );
2828static DECLARE_WRITE8_DEVICE_HANDLER( zwackery_pia1_w );
2929static WRITE_LINE_DEVICE_HANDLER( zwackery_ca2_w );
3030static WRITE_LINE_DEVICE_HANDLER( zwackery_pia_irq );
3131
32static TIMER_CALLBACK( counter_fired_callback );
3332
3433
3534
35
3636/*************************************
3737 *
3838 *  6821 PIA declarations
r18112r18113
125125   {
126126      struct counter_state *m6840 = &m_m6840_state[i];
127127
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));
129129
130130      state_save_register_item(machine(), "m6840", NULL, i, m6840->control);
131131      state_save_register_item(machine(), "m6840", NULL, i, m6840->latch);
r18112r18113
177177{
178178   /* for the most part all MCR/68k games are the same */
179179   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);
182181
183182   /* vectors are 1 and 2 */
184183   m_v493_irq_vector = 1;
r18112r18113
196195{
197196   /* for the most part all MCR/68k games are the same */
198197   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);
201199
202200   /* vectors are 5 and 6 */
203201   m_v493_irq_vector = 5;
r18112r18113
223221   /* also set a timer to generate the 493 signal at a specific time before the next VBLANK */
224222   /* the timing of this is crucial for Blasted and Tri-Sports, which check the timing of */
225223   /* VBLANK and 493 using counter 2 */
226   machine().scheduler().timer_set(attotime::from_hz(30) - m_timing_factor, m_v493_callback, m_v493_callback_name);
224   machine().scheduler().timer_set(attotime::from_hz(30) - m_timing_factor, m_v493_callback);
227225}
228226
229227
r18112r18113
242240}
243241
244242
245static TIMER_CALLBACK( mcr68_493_off_callback )
243TIMER_CALLBACK_MEMBER(mcr68_state::mcr68_493_off_callback)
246244{
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());
250247}
251248
252249
253static TIMER_CALLBACK( mcr68_493_callback )
250TIMER_CALLBACK_MEMBER(mcr68_state::mcr68_493_callback)
254251{
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));
259255   logerror("--- (INT1) ---\n");
260256}
261257
r18112r18113
302298}
303299
304300
305static TIMER_CALLBACK( zwackery_493_off_callback )
301TIMER_CALLBACK_MEMBER(mcr68_state::zwackery_493_off_callback)
306302{
307   pia6821_device *pia = machine.device<pia6821_device>("pia0");
303   pia6821_device *pia = machine().device<pia6821_device>("pia0");
308304   pia->ca1_w(0);
309305}
310306
311307
312static TIMER_CALLBACK( zwackery_493_callback )
308TIMER_CALLBACK_MEMBER(mcr68_state::zwackery_493_callback)
313309{
314   pia6821_device *pia = machine.device<pia6821_device>("pia0");
310   pia6821_device *pia = machine().device<pia6821_device>("pia0");
315311
316312   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));
318314}
319315
320316
r18112r18113
402398}
403399
404400
405static TIMER_CALLBACK( counter_fired_callback )
401TIMER_CALLBACK_MEMBER(mcr68_state::counter_fired_callback)
406402{
407   mcr68_state *state = machine.driver_data<mcr68_state>();
408403   int count = param >> 2;
409404   int counter = param & 3;
410   struct counter_state *m6840 = &state->m_m6840_state[counter];
405   struct counter_state *m6840 = &m_m6840_state[counter];
411406
412407   /* reset the timer */
413408   m6840->timer_active = 0;
414409
415410   /* 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);
417412}
418413
419414
trunk/src/mame/machine/n64.c
r18112r18113
1616// device type definition
1717const device_type N64PERIPH = &device_creator<n64_periphs>;
1818
19static TIMER_CALLBACK(ai_timer_callback);
20static TIMER_CALLBACK(pi_dma_callback);
21static TIMER_CALLBACK(vi_scanline_callback);
2219
20
21
22
2323n64_periphs::n64_periphs(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2424    : device_t(mconfig, N64PERIPH, "N64 Periphal Chips", tag, owner, clock)
2525    , m_nvram_image(NULL)
2626{
2727}
2828
29static TIMER_CALLBACK(reset_timer_callback)
29TIMER_CALLBACK_MEMBER(n64_periphs::reset_timer_callback)
3030{
31   n64_periphs *periphs = machine.device<n64_periphs>("rcp");
32   periphs->reset_tick();
31   reset_tick();
3332}
3433
3534void n64_periphs::reset_tick()
r18112r18113
6362
6463void n64_periphs::device_start()
6564{
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));
7069}
7170
7271void n64_periphs::device_reset()
r18112r18113
999998   sp_set_status
1000999};
10011000
1002static TIMER_CALLBACK(vi_scanline_callback)
1001TIMER_CALLBACK_MEMBER(n64_periphs::vi_scanline_callback)
10031002{
1004   machine.device<n64_periphs>("rcp")->vi_scanline_tick();
1003   machine().device<n64_periphs>("rcp")->vi_scanline_tick();
10051004}
10061005
10071006void n64_periphs::vi_scanline_tick()
r18112r18113
13041303   ai_timer->adjust(period);
13051304}
13061305
1307static TIMER_CALLBACK(ai_timer_callback)
1306TIMER_CALLBACK_MEMBER(n64_periphs::ai_timer_callback)
13081307{
1309   machine.device<n64_periphs>("rcp")->ai_timer_tick();
1308   machine().device<n64_periphs>("rcp")->ai_timer_tick();
13101309}
13111310
13121311void n64_periphs::ai_timer_tick()
r18112r18113
14041403
14051404// Peripheral Interface
14061405
1407static TIMER_CALLBACK(pi_dma_callback)
1406TIMER_CALLBACK_MEMBER(n64_periphs::pi_dma_callback)
14081407{
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();
14111410}
14121411
14131412void n64_periphs::pi_dma_tick()
trunk/src/mame/machine/volfied.c
r18112r18113
278278};
279279
280280
281static TIMER_CALLBACK( volfied_timer_callback )
281TIMER_CALLBACK_MEMBER(volfied_state::volfied_timer_callback)
282282{
283   volfied_state *state = machine.driver_data<volfied_state>();
284283
285284   // Palette commands - palette data written to bank 0: $10 - $af
286   if (state->m_current_cmd >= 0x1 && state->m_current_cmd < 0x12)
285   if (m_current_cmd >= 0x1 && m_current_cmd < 0x12)
287286   {
288      const UINT16* palette_data = palette_data_lookup[state->m_current_cmd];
287      const UINT16* palette_data = palette_data_lookup[m_current_cmd];
289288      int i;
290289      for (i = 0; i < 0x50; i++)
291290      {
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;
294293      }
295294   }
296295
297296   // Unknown command - result written to bank 0: $23
298   if (state->m_current_cmd >= 0x81 && state->m_current_cmd < 0x92)
297   if (m_current_cmd >= 0x81 && m_current_cmd < 0x92)
299298   {
300      switch (state->m_current_cmd)
299      switch (m_current_cmd)
301300      {
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;
319318      }
320319   }
321320
322   state->m_current_cmd = 0;
321   m_current_cmd = 0;
323322}
324323
325324/*************************************
r18112r18113
390389         // Palette request cmd - verified to take around 122242 68000 cycles to complete
391390         if (m_current_cmd >= 0x1 && m_current_cmd < 0x12)
392391         {
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));
394393         }
395394         // Unknown cmd - verified to take around 105500 68000 cycles to complete
396395         else if (m_current_cmd >= 0x81 && m_current_cmd < 0x92)
397396         {
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));
399398         }
400399         else
401400         {
trunk/src/mame/machine/qix.c
r18112r18113
462462 *
463463 *************************************/
464464
465static TIMER_CALLBACK( pia_w_callback )
465TIMER_CALLBACK_MEMBER(qix_state::pia_w_callback)
466466{
467467   pia6821_device *device = (pia6821_device *)ptr;
468468   device->write(device->machine().driver_data()->generic_space(), param >> 8, param & 0xff);
r18112r18113
471471
472472WRITE8_DEVICE_HANDLER( qix_pia_w )
473473{
474   qix_state *state = device->machine().driver_data<qix_state>();
474475   /* make all the CPUs synchronize, and only AFTER that write the command to the PIA */
475476   /* 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));
477478}
478479
479480
trunk/src/mame/machine/taitosj.c
r18112r18113
102102}
103103
104104/* timer callback : */
105static TIMER_CALLBACK( taitosj_mcu_real_data_w )
105TIMER_CALLBACK_MEMBER(taitosj_state::taitosj_mcu_real_data_w)
106106{
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;
111110}
112111
113112WRITE8_MEMBER(taitosj_state::taitosj_mcu_data_w)
114113{
115114   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);
117116   /* temporarily boost the interleave to sync things up */
118117   machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
119118}
r18112r18113
168167}
169168
170169/* timer callback : 68705 is going to read data from the Z80 */
171static TIMER_CALLBACK( taitosj_mcu_data_real_r )
170TIMER_CALLBACK_MEMBER(taitosj_state::taitosj_mcu_data_real_r)
172171{
173   taitosj_state *state = machine.driver_data<taitosj_state>();
174   state->m_zready = 0;
172   m_zready = 0;
175173}
176174
177175/* timer callback : 68705 is writing data for the Z80 */
178static TIMER_CALLBACK( taitosj_mcu_status_real_w )
176TIMER_CALLBACK_MEMBER(taitosj_state::taitosj_mcu_status_real_w)
179177{
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;
183180}
184181
185182WRITE8_MEMBER(taitosj_state::taitosj_68705_portB_w)
r18112r18113
193190   if (~data & 0x02)
194191   {
195192      /* 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));
197194      machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE);
198195      m_portA_in = m_fromz80;
199196      LOG(("%04x: 68705 <- Z80 %02x\n", space.device().safe_pc(), m_portA_in));
r18112r18113
207204      LOG(("%04x: 68705 -> Z80 %02x\n", space.device().safe_pc(), m_portA_out));
208205
209206      /* 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);
211208   }
212209   if (~data & 0x10)
213210   {
trunk/src/mame/machine/vertigo.c
r18112r18113
165165}
166166
167167
168static TIMER_CALLBACK( sound_command_w )
168TIMER_CALLBACK_MEMBER(vertigo_state::sound_command_w)
169169{
170   vertigo_state *state = machine.driver_data<vertigo_state>();
171   exidy440_sound_command(state->m_custom, param);
170   exidy440_sound_command(m_custom, param);
172171
173172   /* It is important that the sound cpu ACKs the sound command
174173       quickly. Otherwise the main CPU gives up with sound. Boosting
175174       the interleave for a while helps. */
176175
177   machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
176   machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
178177}
179178
180179
181180WRITE16_MEMBER(vertigo_state::vertigo_audio_w)
182181{
183182   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);
185184}
186185
187186
trunk/src/mame/machine/namcos2.c
r18112r18113
1515#include "includes/namcos2.h"
1616#include "machine/nvram.h"
1717
18static TIMER_CALLBACK( namcos2_posirq_tick );
18
1919static void InitC148(void);
2020
2121static emu_timer *namcos2_posirq_timer;
r18112r18113
108108   namcos2_kickstart = NULL;
109109   namcos2_eeprom = auto_alloc_array(machine(), UINT8, namcos2_eeprom_size);
110110   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));
112112}
113113
114114MACHINE_RESET_MEMBER(namcos2_shared_state,namcos2)
r18112r18113
657657   return downcast<namcos2_state *>(state)->get_pos_irq_scanline();
658658}
659659
660static TIMER_CALLBACK( namcos2_posirq_tick )
660TIMER_CALLBACK_MEMBER(namcos2_shared_state::namcos2_posirq_tick)
661661{
662   namcos2_shared_state *state = machine.driver_data<namcos2_shared_state>();
663   if (state->is_system21()) {
662   if (is_system21()) {
664663      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);
667666      }
668667      return;
669668   }
670669
671670   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);
675674   }
676675}
677676
trunk/src/mame/machine/opwolf.c
r18112r18113
273273};
274274
275275
276static TIMER_CALLBACK( opwolf_timer_callback )
276TIMER_CALLBACK_MEMBER(opwolf_state::opwolf_timer_callback)
277277{
278   opwolf_state *state = machine.driver_data<opwolf_state>();
279278
280279   // Level data command
281   if (state->m_current_cmd == 0xf5)
280   if (m_current_cmd == 0xf5)
282281   {
283      int level = state->m_cchip_ram[0x1b];
282      int level = m_cchip_ram[0x1b];
284283      const UINT16* level_data = level_data_lookup[level];
285284      int i = 0;
286285      for (i = 0; i < 0xcc; i++)
287286      {
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;
290289      }
291290
292291      // 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;
309308
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
312311   }
313312
314   state->m_current_cmd = 0;
313   m_current_cmd = 0;
315314}
316315
317316static void updateDifficulty( running_machine &machine, int mode )
r18112r18113
524523 *
525524 *************************************/
526525
527static TIMER_CALLBACK( cchip_timer )
526TIMER_CALLBACK_MEMBER(opwolf_state::cchip_timer)
528527{
529   opwolf_state *state = machine.driver_data<opwolf_state>();
530528
531529   // 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();
534532
535533   // Coin slots
536   if (state->m_cchip_ram[0x4] != state->m_cchip_last_04)
534   if (m_cchip_ram[0x4] != m_cchip_last_04)
537535   {
538536      int slot = -1;
539537
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;
542540
543541      if (slot != -1)
544542      {
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])
547545         {
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];
552550         }
553         coin_counter_w(machine, slot, 1);
551         coin_counter_w(machine(), slot, 1);
554552      }
555553
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;
558556   }
559   state->m_cchip_last_04 = state->m_cchip_ram[0x4];
557   m_cchip_last_04 = m_cchip_ram[0x4];
560558
561559   // Service switch
562   if (state->m_cchip_ram[0x5] != state->m_cchip_last_05)
560   if (m_cchip_ram[0x5] != m_cchip_last_05)
563561   {
564      if ((state->m_cchip_ram[0x5] & 4)==0)
562      if ((m_cchip_ram[0x5] & 4)==0)
565563      {
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;
569567      }
570568   }
571   state->m_cchip_last_05=state->m_cchip_ram[0x5];
569   m_cchip_last_05=m_cchip_ram[0x5];
572570
573571   // 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);
578576
579577   // Special handling for last level
580   if (state->m_cchip_ram[0x1b] == 0x6)
578   if (m_cchip_ram[0x1b] == 0x6)
581579   {
582580      // Check for triggering final helicopter (end boss)
583      if (state->m_c58a == 0)
581      if (m_c58a == 0)
584582      {
585         if ((state->m_cchip_ram[0x72] & 0x7f) >= 8 && state->m_cchip_ram[0x74] == 0 && state->m_cchip_ram[0x1c] == 0 && state->m_cchip_ram[0x1d] == 0 && state->m_cchip_ram[0x1f] == 0)
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)
586584         {
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;
590588         }
591589      }
592590
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;
595593
596      if (state->m_c58a != 0)
594      if (m_c58a != 0)
597595      {
598         if (state->m_c589 == 0 && state->m_cchip_ram[0x27] == 0 && state->m_cchip_ram[0x75] == 0 && state->m_cchip_ram[0x1c] == 0 && state->m_cchip_ram[0x1d] == 0 && state->m_cchip_ram[0x1e] == 0 && state->m_cchip_ram[0x1f] == 0)
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)
599597         {
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;
603601         }
604602      }
605603
606      if (state->m_cchip_ram[0x2b] == 0x1)
604      if (m_cchip_ram[0x2b] == 0x1)
607605      {
608         state->m_cchip_ram[0x2b] = 0;
606         m_cchip_ram[0x2b] = 0;
609607
610         if (state->m_cchip_ram[0x30] == 0x1)
608         if (m_cchip_ram[0x30] == 0x1)
611609         {
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]--;
614612         }
615613
616         if (state->m_cchip_ram[0x72] == 0x9)
614         if (m_cchip_ram[0x72] == 0x9)
617615         {
618            if (state->m_cchip_ram[0x76] != 0x4)
616            if (m_cchip_ram[0x76] != 0x4)
619617            {
620               state->m_cchip_ram[0x76] = 3;
618               m_cchip_ram[0x76] = 3;
621619            }
622620         }
623621         else
624622         {
625623            // This timer is derived from the bootleg rather than the real board, I'm not 100% sure about it
626            state->m_c588 |= 0x80;
624            m_c588 |= 0x80;
627625
628            state->m_cchip_ram[0x72] = state->m_c588;
629            state->m_c588++;
626            m_cchip_ram[0x72] = m_c588;
627            m_c588++;
630628
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]--;
634632         }
635633      }
636634
637635      // Update difficulty settings
638      if (state->m_cchip_ram[0x76] == 0)
636      if (m_cchip_ram[0x76] == 0)
639637      {
640         state->m_cchip_ram[0x76] = 1;
641         updateDifficulty(machine, 1);
638         m_cchip_ram[0x76] = 1;
639         updateDifficulty(machine(), 1);
642640      }
643641   }
644642
645643   // These variables are cleared every frame during attract mode and the intro.
646   if (state->m_cchip_ram[0x34] < 2)
644   if (m_cchip_ram[0x34] < 2)
647645   {
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;
664662   }
665663
666664   // Check for level completion (all enemies destroyed)
667   if (state->m_cchip_ram[0x1c] == 0 && state->m_cchip_ram[0x1d] == 0 && state->m_cchip_ram[0x1e] == 0 && state->m_cchip_ram[0x1f] == 0 && state->m_cchip_ram[0x20] == 0)
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)
668666   {
669667      // Special handling for end of level 6
670      if (state->m_cchip_ram[0x1b] == 0x6)
668      if (m_cchip_ram[0x1b] == 0x6)
671669      {
672670         // 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;
675673      }
676674      else
677675      {
678676         // Signal end of level
679         state->m_cchip_ram[0x32] = 1;
677         m_cchip_ram[0x32] = 1;
680678      }
681679   }
682680
683   if (state->m_cchip_ram[0xe] == 1)
681   if (m_cchip_ram[0xe] == 1)
684682   {
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;
687685   }
688686
689687   // Access level data command (address 0xf5 goes from 1 -> 0)
690   if (state->m_cchip_ram[0x7a] == 0 && state->m_cchip_last_7a != 0 && state->m_current_cmd != 0xf5)
688   if (m_cchip_ram[0x7a] == 0 && m_cchip_last_7a != 0 && m_current_cmd != 0xf5)
691689   {
692690      // 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));
695693   }
696   state->m_cchip_last_7a = state->m_cchip_ram[0x7a];
694   m_cchip_last_7a = m_cchip_ram[0x7a];
697695
698696   // This seems to some kind of periodic counter - results are expected
699697   // by the 68k when the counter reaches 0xa
700   if (state->m_cchip_ram[0x7f] == 0xa)
698   if (m_cchip_ram[0x7f] == 0xa)
701699   {
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;
704702   }
705703
706704   // 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;
709707}
710708
711709/*************************************
r18112r18113
747745   state->m_cchip_coins_for_credit[1] = 1;
748746   state->m_cchip_credits_for_coin[1] = 1;
749747
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));
751749}
trunk/src/mame/machine/mcr.c
r18112r18113
4040 *
4141 *************************************/
4242
43static TIMER_CALLBACK( ipu_watchdog_reset );
43
4444static DECLARE_WRITE8_DEVICE_HANDLER( ipu_break_changed );
4545
4646
r18112r18113
164164MACHINE_START_MEMBER(mcr_state,nflfoot)
165165{
166166   /* 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));
168168}
169169
170170
r18112r18113
250250}
251251
252252
253static TIMER_CALLBACK( ipu_watchdog_reset )
253TIMER_CALLBACK_MEMBER(mcr_state::ipu_watchdog_reset)
254254{
255255   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();
261261}
262262
263263
trunk/src/mame/includes/buggychl.h
r18112r18113
5656   virtual void video_start();
5757   virtual void palette_init();
5858   UINT32 screen_update_buggychl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
59   TIMER_CALLBACK_MEMBER(nmi_callback);
5960};
trunk/src/mame/includes/taito_f2.h
r18112r18113
143143   void screen_eof_taitof2_full_buffer_delayed(screen_device &screen, bool state);
144144   void screen_eof_taitof2_partial_buffer_delayed_qzchikyu(screen_device &screen, bool state);
145145   INTERRUPT_GEN_MEMBER(taitof2_interrupt);
146   TIMER_CALLBACK_MEMBER(taitof2_interrupt6);
146147};
trunk/src/mame/includes/40love.h
r18112r18113
9696   DECLARE_MACHINE_RESET(common);
9797   DECLARE_MACHINE_RESET(ta7630);
9898   UINT32 screen_update_fortyl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
99   TIMER_CALLBACK_MEMBER(nmi_callback);
99100};
trunk/src/mame/includes/gottlieb.h
r18112r18113
303303   DECLARE_VIDEO_START(screwloo);
304304   UINT32 screen_update_gottlieb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
305305   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);
306310};
307311
308312/*----------- defined in video/gottlieb.c -----------*/
trunk/src/mame/includes/galaga.h
r18112r18113
6060   void screen_eof_galaga(screen_device &screen, bool state);
6161   INTERRUPT_GEN_MEMBER(main_vblank_irq);
6262   INTERRUPT_GEN_MEMBER(sub_vblank_irq);
63   TIMER_CALLBACK_MEMBER(cpu3_interrupt_callback);
6364};
6465
6566class xevious_state : public galaga_state
trunk/src/mame/includes/runaway.h
r18112r18113
2626   DECLARE_VIDEO_START(qwak);
2727   UINT32 screen_update_runaway(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
2828   UINT32 screen_update_qwak(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
29   TIMER_CALLBACK_MEMBER(interrupt_callback);
2930};
trunk/src/mame/includes/groundfx.h
r18112r18113
3939   virtual void video_start();
4040   UINT32 screen_update_groundfx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4141   INTERRUPT_GEN_MEMBER(groundfx_interrupt);
42   TIMER_CALLBACK_MEMBER(groundfx_interrupt5);
4243};
trunk/src/mame/includes/micro3d.h
r18112r18113
115115   virtual void video_start();
116116   virtual void video_reset();
117117   INTERRUPT_GEN_MEMBER(micro3d_vblank);
118   TIMER_CALLBACK_MEMBER(mac_done_callback);
119   TIMER_CALLBACK_MEMBER(adc_done_callback);
118120};
119121
120122struct micro3d_vtx
trunk/src/mame/includes/snes.h
r18112r18113
544544   UINT16 *m_snes_cgram;   /* Palette RAM */
545545   UINT8  *m_snes_vram;   /* Video RAM (TODO: Should be 16-bit, but it's easier this way) */
546546
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);
547554};
548555
549556/* Special chips, checked at init and used in memory handlers */
trunk/src/mame/includes/taito_z.h
r18112r18113
8686   UINT32 screen_update_dblaxle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8787   UINT32 screen_update_racingb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8888   INTERRUPT_GEN_MEMBER(sci_interrupt);
89   TIMER_CALLBACK_MEMBER(taitoz_interrupt6);
90   TIMER_CALLBACK_MEMBER(taitoz_cpub_interrupt5);
8991};
trunk/src/mame/includes/vendetta.h
r18112r18113
4545   virtual void machine_reset();
4646   UINT32 screen_update_vendetta(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4747   INTERRUPT_GEN_MEMBER(vendetta_irq);
48   TIMER_CALLBACK_MEMBER(z80_nmi_callback);
4849};
4950
5051/*----------- defined in video/vendetta.c -----------*/
trunk/src/mame/includes/n8080.h
r18112r18113
8181   UINT32 screen_update_sheriff(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8282   UINT32 screen_update_helifire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8383   void screen_eof_helifire(screen_device &screen, bool state);
84   TIMER_CALLBACK_MEMBER(spacefev_stop_red_cannon);
8485};
8586
8687/*----------- defined in video/n8080.c -----------*/
trunk/src/mame/includes/msisaac.h
r18112r18113
7373   virtual void video_start();
7474   DECLARE_MACHINE_RESET(ta7630);
7575   UINT32 screen_update_msisaac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
76   TIMER_CALLBACK_MEMBER(nmi_callback);
7677};
trunk/src/mame/includes/fuukifg2.h
r18112r18113
4444   virtual void machine_reset();
4545   virtual void video_start();
4646   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);
4750};
trunk/src/mame/includes/snk.h
r18112r18113
169169   UINT32 screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
170170   UINT32 screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
171171   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);
172174};
trunk/src/mame/includes/turbo.h
r18112r18113
131131   UINT32 screen_update_turbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
132132   UINT32 screen_update_subroc3d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
133133   UINT32 screen_update_buckrog(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
134   TIMER_CALLBACK_MEMBER(delayed_i8255_w);
134135};
135136
136137
trunk/src/mame/includes/segas32.h
r18112r18113
178178   UINT32 screen_update_multi32_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
179179   UINT32 screen_update_multi32_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
180180   INTERRUPT_GEN_MEMBER(start_of_vblank_int);
181   TIMER_CALLBACK_MEMBER(end_of_vblank_int);
182   TIMER_CALLBACK_MEMBER(update_sprites);
181183};
182184
183185/*----------- defined in machine/segas32.c -----------*/
trunk/src/mame/includes/taito_f3.h
r18112r18113
273273   UINT32 screen_update_f3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
274274   void screen_eof_f3(screen_device &screen, bool state);
275275   INTERRUPT_GEN_MEMBER(f3_interrupt2);
276   TIMER_CALLBACK_MEMBER(f3_interrupt3);
276277};
trunk/src/mame/includes/champbas.h
r18112r18113
6464   UINT32 screen_update_exctsccr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6565   void screen_eof_champbas(screen_device &screen, bool state);
6666   INTERRUPT_GEN_MEMBER(vblank_irq);
67   TIMER_CALLBACK_MEMBER(exctsccr_fm_callback);
6768};
trunk/src/mame/includes/equites.h
r18112r18113
106106   DECLARE_PALETTE_INIT(splndrbt);
107107   UINT32 screen_update_equites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
108108   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);
109111};
trunk/src/mame/includes/arkanoid.h
r18112r18113
7979   DECLARE_VIDEO_START(arkanoid);
8080   UINT32 screen_update_arkanoid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8181   UINT32 screen_update_hexa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
82   TIMER_CALLBACK_MEMBER(test);
8283};
trunk/src/mame/includes/firetrk.h
r18112r18113
105105   UINT32 screen_update_superbug(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
106106   UINT32 screen_update_montecar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
107107   INTERRUPT_GEN_MEMBER(firetrk_interrupt);
108   TIMER_CALLBACK_MEMBER(periodic_callback);
108109};
109110
110111
trunk/src/mame/includes/crgolf.h
r18112r18113
5454   virtual void machine_reset();
5555   DECLARE_VIDEO_START(crgolf);
5656   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);
5759};
5860
5961/*----------- defined in video/crgolf.c -----------*/
trunk/src/mame/includes/lsasquad.h
r18112r18113
6161   DECLARE_MACHINE_RESET(lsasquad);
6262   UINT32 screen_update_lsasquad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6363   UINT32 screen_update_daikaiju(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
64   TIMER_CALLBACK_MEMBER(nmi_callback);
6465};
trunk/src/mame/includes/vectrex.h
r18112r18113
7070   virtual void video_start();
7171   DECLARE_VIDEO_START(raaspec);
7272   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);
7380};
7481
7582
trunk/src/mame/includes/williams.h
r18112r18113
107107   UINT32 screen_update_williams(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
108108   UINT32 screen_update_williams2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
109109   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);
110115};
111116
112117
r18112r18113
121126   DECLARE_DRIVER_INIT(joust2);
122127   DECLARE_MACHINE_START(joust2);
123128   DECLARE_MACHINE_RESET(joust2);
124
129   TIMER_CALLBACK_MEMBER(joust2_deferred_snd_cmd_w);
125130};
126131
127132/*----------- defined in drivers/williams.c -----------*/
trunk/src/mame/includes/fuukifg3.h
r18112r18113
6363   virtual void video_start();
6464   UINT32 screen_update_fuuki32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6565   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);
6669};
trunk/src/mame/includes/changela.h
r18112r18113
9090   virtual void video_start();
9191   UINT32 screen_update_changela(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
9292   INTERRUPT_GEN_MEMBER(chl_mcu_irq);
93   TIMER_CALLBACK_MEMBER(changela_scanline_callback);
9394};
trunk/src/mame/includes/triplhnt.h
r18112r18113
5151   virtual void video_start();
5252   virtual void palette_init();
5353   UINT32 screen_update_triplhnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
54   TIMER_CALLBACK_MEMBER(triplhnt_hit_callback);
5455};
5556
5657
trunk/src/mame/includes/starwars.h
r18112r18113
6262   DECLARE_DRIVER_INIT(esb);
6363   DECLARE_DRIVER_INIT(starwars);
6464   virtual void machine_reset();
65   TIMER_CALLBACK_MEMBER(math_run_clear);
6566};
6667
6768
trunk/src/mame/includes/wolfpack.h
r18112r18113
5656   virtual void palette_init();
5757   UINT32 screen_update_wolfpack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5858   void screen_eof_wolfpack(screen_device &screen, bool state);
59   TIMER_CALLBACK_MEMBER(periodic_callback);
5960};
trunk/src/mame/includes/stfight.h
r18112r18113
4747   virtual void palette_init();
4848   UINT32 screen_update_stfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4949   INTERRUPT_GEN_MEMBER(stfight_vb_interrupt);
50   TIMER_CALLBACK_MEMBER(stfight_interrupt_1);
5051};
5152
5253/*----------- defined in machine/stfight.c -----------*/
trunk/src/mame/includes/asterix.h
r18112r18113
4444   virtual void machine_reset();
4545   UINT32 screen_update_asterix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4646   INTERRUPT_GEN_MEMBER(asterix_interrupt);
47   TIMER_CALLBACK_MEMBER(nmi_callback);
4748};
4849
4950/*----------- defined in video/asterix.c -----------*/
trunk/src/mame/includes/toypop.h
r18112r18113
5353   INTERRUPT_GEN_MEMBER(toypop_main_vblank_irq);
5454   INTERRUPT_GEN_MEMBER(toypop_sound_timer_irq);
5555   INTERRUPT_GEN_MEMBER(toypop_m68000_interrupt);
56   TIMER_CALLBACK_MEMBER(namcoio_run);
5657};
trunk/src/mame/includes/nycaptor.h
r18112r18113
104104   virtual void video_start();
105105   DECLARE_MACHINE_RESET(ta7630);
106106   UINT32 screen_update_nycaptor(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
107   TIMER_CALLBACK_MEMBER(nmi_callback);
107108};
trunk/src/mame/includes/qix.h
r18112r18113
8484   virtual void machine_reset();
8585   DECLARE_MACHINE_START(qixmcu);
8686   DECLARE_VIDEO_START(qix);
87   TIMER_CALLBACK_MEMBER(pia_w_callback);
8788};
8889
8990
trunk/src/mame/includes/cidelsa.h
r18112r18113
7272   UINT8 *m_charram;
7373   DECLARE_CUSTOM_INPUT_MEMBER(cdp1869_pcb_r);
7474   DECLARE_INPUT_CHANGED_MEMBER(ef_w);
75   TIMER_CALLBACK_MEMBER(set_cpu_mode);
7576};
7677
7778class draco_state : public cidelsa_state
trunk/src/mame/includes/bublbobl.h
r18112r18113
110110   DECLARE_MACHINE_RESET(common);
111111   UINT32 screen_update_bublbobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
112112   INTERRUPT_GEN_MEMBER(bublbobl_m68705_interrupt);
113   TIMER_CALLBACK_MEMBER(nmi_callback);
114   TIMER_CALLBACK_MEMBER(bublbobl_m68705_irq_ack);
113115};
trunk/src/mame/includes/lockon.h
r18112r18113
105105   virtual void palette_init();
106106   UINT32 screen_update_lockon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
107107   void screen_eof_lockon(screen_device &screen, bool state);
108   TIMER_CALLBACK_MEMBER(cursor_callback);
109   TIMER_CALLBACK_MEMBER(bufend_callback);
108110};
trunk/src/mame/includes/seta.h
r18112r18113
199199   void screen_eof_seta_buffer_sprites(screen_device &screen, bool state);
200200   void screen_eof_setaroul(screen_device &screen, bool state);
201201   INTERRUPT_GEN_MEMBER(wrofaero_interrupt);
202   TIMER_CALLBACK_MEMBER(uPD71054_timer_callback);
203   TIMER_CALLBACK_MEMBER(keroppi_prize_hop_callback);
202204};
203205
204206/*----------- defined in video/seta.c -----------*/
trunk/src/mame/includes/tnzs.h
r18112r18113
9999   UINT32 screen_update_tnzs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
100100   void screen_eof_tnzs(screen_device &screen, bool state);
101101   INTERRUPT_GEN_MEMBER(arknoid2_interrupt);
102   TIMER_CALLBACK_MEMBER(kludge_callback);
102103};
trunk/src/mame/includes/mystston.h
r18112r18113
4747   DECLARE_VIDEO_START(mystston);
4848   DECLARE_VIDEO_RESET(mystston);
4949   UINT32 screen_update_mystston(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
50   TIMER_CALLBACK_MEMBER(interrupt_callback);
5051};
5152
5253/*----------- defined in drivers/mystston.c -----------*/
trunk/src/mame/includes/midyunit.h
r18112r18113
107107   DECLARE_VIDEO_START(midyunit_6bit);
108108   DECLARE_VIDEO_START(mkyawdim);
109109   DECLARE_VIDEO_START(common);
110   TIMER_CALLBACK_MEMBER(dma_callback);
111   TIMER_CALLBACK_MEMBER(autoerase_line);
110112};
111113/*----------- defined in video/midyunit.c -----------*/
112114void midyunit_to_shiftreg(address_space &space, UINT32 address, UINT16 *shiftreg);
trunk/src/mame/includes/nbmj9195.h
r18112r18113
112112   DECLARE_VIDEO_START(nbmj9195_nb22090);
113113   UINT32 screen_update_nbmj9195(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
114114   INTERRUPT_GEN_MEMBER(ctc0_trg1);
115   TIMER_CALLBACK_MEMBER(blitter_timer_callback);
115116};
116117
117118/*----------- defined in video/nbmj9195.c -----------*/
trunk/src/mame/includes/artmagic.h
r18112r18113
4949   virtual void machine_start();
5050   virtual void machine_reset();
5151   virtual void video_start();
52   TIMER_CALLBACK_MEMBER(irq_off);
5253};
5354
5455
trunk/src/mame/includes/wgp.h
r18112r18113
7070   DECLARE_VIDEO_START(wgp2);
7171   UINT32 screen_update_wgp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7272   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);
7376};
trunk/src/mame/includes/irobot.h
r18112r18113
7878   virtual void video_start();
7979   virtual void palette_init();
8080   UINT32 screen_update_irobot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
81   TIMER_CALLBACK_MEMBER(scanline_callback);
8182};
8283
8384/*----------- defined in machine/irobot.c -----------*/
trunk/src/mame/includes/dcheese.h
r18112r18113
4848   virtual void palette_init();
4949   UINT32 screen_update_dcheese(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5050   INTERRUPT_GEN_MEMBER(dcheese_vblank);
51   TIMER_CALLBACK_MEMBER(blitter_scanline_callback);
52   TIMER_CALLBACK_MEMBER(dcheese_signal_irq_callback);
5153};
5254
5355/*----------- defined in drivers/dcheese.c -----------*/
trunk/src/mame/includes/ccastles.h
r18112r18113
6868   virtual void machine_reset();
6969   virtual void video_start();
7070   UINT32 screen_update_ccastles(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
71   TIMER_CALLBACK_MEMBER(clock_irq);
7172};
trunk/src/mame/includes/neogeo.h
r18112r18113
210210   virtual void video_start();
211211   virtual void video_reset();
212212   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);
213218};
214219
215220
trunk/src/mame/includes/policetr.h
r18112r18113
4848   virtual void video_start();
4949   UINT32 screen_update_policetr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5050   INTERRUPT_GEN_MEMBER(irq4_gen);
51   TIMER_CALLBACK_MEMBER(irq5_gen);
5152};
trunk/src/mame/includes/coolpool.h
r18112r18113
5858   DECLARE_DRIVER_INIT(9ballsht);
5959   DECLARE_MACHINE_RESET(amerdart);
6060   DECLARE_MACHINE_RESET(coolpool);
61   TIMER_CALLBACK_MEMBER(deferred_iop_w);
6162};
trunk/src/mame/includes/dc.h
r18112r18113
9797   virtual void video_start();
9898   DECLARE_MACHINE_RESET(naomi);
9999   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);
100116};
101117
102118/*----------- defined in machine/dc.c -----------*/
trunk/src/mame/includes/midtunit.h
r18112r18113
6565   DECLARE_DRIVER_INIT(mk2);
6666   DECLARE_MACHINE_RESET(midtunit);
6767   DECLARE_VIDEO_START(midtunit);
68   TIMER_CALLBACK_MEMBER(dma_callback);
6869};
6970/*----------- defined in video/midtunit.c -----------*/
7071extern UINT8 midtunit_gfx_rom_large;
trunk/src/mame/includes/mcr68.h
r18112r18113
4545   struct counter_state m_m6840_state[3];
4646   UINT8 m_v493_irq_state;
4747   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;
5049   UINT8 m_zwackery_sound_data;
5150   attotime m_m6840_counter_periods[3];
5251   attotime m_m6840_internal_counter_period;
r18112r18113
9998   UINT32 screen_update_zwackery(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
10099   UINT32 screen_update_mcr68(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
101100   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);
102106};
103107
104108/*----------- defined in machine/mcr68.c -----------*/
trunk/src/mame/includes/rollerg.h
r18112r18113
3737   virtual void machine_reset();
3838   virtual void video_start();
3939   UINT32 screen_update_rollerg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
40   TIMER_CALLBACK_MEMBER(nmi_callback);
4041};
4142
4243/*----------- defined in video/rollerg.c -----------*/
trunk/src/mame/includes/niyanpai.h
r18112r18113
8181   virtual void video_start();
8282   UINT32 screen_update_niyanpai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8383   INTERRUPT_GEN_MEMBER(niyanpai_interrupt);
84   TIMER_CALLBACK_MEMBER(blitter_timer_callback);
8485};
trunk/src/mame/includes/balsente.h
r18112r18113
194194   virtual void video_start();
195195   UINT32 screen_update_balsente(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
196196   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);
197201};
198202
199203
trunk/src/mame/includes/rainbow.h
r18112r18113
4949   DECLARE_VIDEO_START(jumping);
5050   UINT32 screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5151   UINT32 screen_update_jumping(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
52   TIMER_CALLBACK_MEMBER(cchip_timer);
5253};
5354
5455/*----------- defined in machine/rainbow.c -----------*/
trunk/src/mame/includes/undrfire.h
r18112r18113
4646   UINT32 screen_update_undrfire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4747   UINT32 screen_update_cbombers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4848   INTERRUPT_GEN_MEMBER(undrfire_interrupt);
49   TIMER_CALLBACK_MEMBER(interrupt5);
4950};
trunk/src/mame/includes/mappy.h
r18112r18113
5858   INTERRUPT_GEN_MEMBER(mappy_main_vblank_irq);
5959   INTERRUPT_GEN_MEMBER(sub_vblank_irq);
6060   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);
6165};
trunk/src/mame/includes/cvs.h
r18112r18113
106106   DECLARE_PALETTE_INIT(cvs);
107107   UINT32 screen_update_cvs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
108108   INTERRUPT_GEN_MEMBER(cvs_main_cpu_interrupt);
109   TIMER_CALLBACK_MEMBER(cvs_393hz_timer_cb);
109110};
110111
111112/*----------- defined in video/cvs.c -----------*/
trunk/src/mame/includes/gijoe.h
r18112r18113
4646   virtual void video_start();
4747   UINT32 screen_update_gijoe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4848   INTERRUPT_GEN_MEMBER(gijoe_interrupt);
49   TIMER_CALLBACK_MEMBER(dmaend_callback);
4950};
5051
5152/*----------- defined in video/gijoe.c -----------*/
trunk/src/mame/includes/twin16.h
r18112r18113
6565   void screen_eof_twin16(screen_device &screen, bool state);
6666   INTERRUPT_GEN_MEMBER(CPUA_interrupt);
6767   INTERRUPT_GEN_MEMBER(CPUB_interrupt);
68   TIMER_CALLBACK_MEMBER(twin16_sprite_tick);
6869};
6970
7071/*----------- defined in drivers/twin16.c -----------*/
trunk/src/mame/includes/rpunch.h
r18112r18113
4040   virtual void machine_reset();
4141   virtual void video_start();
4242   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);
4345};
trunk/src/mame/includes/cloud9.h
r18112r18113
5959   virtual void machine_reset();
6060   virtual void video_start();
6161   UINT32 screen_update_cloud9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
62   TIMER_CALLBACK_MEMBER(clock_irq);
6263};
trunk/src/mame/includes/simpsons.h
r18112r18113
4141   virtual void machine_reset();
4242   UINT32 screen_update_simpsons(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4343   INTERRUPT_GEN_MEMBER(simpsons_irq);
44   TIMER_CALLBACK_MEMBER(nmi_callback);
45   TIMER_CALLBACK_MEMBER(dmaend_callback);
4446};
4547
4648/*----------- defined in machine/simpsons.c -----------*/
trunk/src/mame/includes/tubep.h
r18112r18113
7878   DECLARE_PALETTE_INIT(rjammer);
7979   UINT32 screen_update_tubep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8080   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);
8184};
8285
8386
trunk/src/mame/includes/namcofl.h
r18112r18113
5858   DECLARE_MACHINE_RESET(namcofl);
5959   DECLARE_VIDEO_START(namcofl);
6060   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);
6164};
trunk/src/mame/includes/exidy.h
r18112r18113
6969   DECLARE_MACHINE_START(teetert);
7070   UINT32 screen_update_exidy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7171   INTERRUPT_GEN_MEMBER(exidy_vblank_interrupt);
72   TIMER_CALLBACK_MEMBER(collision_irq_callback);
7273};
7374
7475/*----------- defined in video/exidy.c -----------*/
trunk/src/mame/includes/hyhoo.h
r18112r18113
2424   DECLARE_DRIVER_INIT(hyhoo);
2525   virtual void video_start();
2626   UINT32 screen_update_hyhoo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
27   TIMER_CALLBACK_MEMBER(blitter_timer_callback);
2728};
trunk/src/mame/includes/volfied.h
r18112r18113
4444   virtual void machine_reset();
4545   virtual void video_start();
4646   UINT32 screen_update_volfied(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
47   TIMER_CALLBACK_MEMBER(volfied_timer_callback);
4748};
4849
4950
trunk/src/mame/includes/mw8080bw.h
r18112r18113
144144   UINT32 screen_update_phantom2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
145145   UINT32 screen_update_invaders(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
146146   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);
147149};
148150
149151
trunk/src/mame/includes/itech32.h
r18112r18113
159159   DECLARE_MACHINE_RESET(drivedge);
160160   UINT32 screen_update_itech32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
161161   INTERRUPT_GEN_MEMBER(generate_int1);
162   TIMER_CALLBACK_MEMBER(delayed_sound_data_w);
163   TIMER_CALLBACK_MEMBER(scanline_interrupt);
162164};
163165
164166/*----------- defined in drivers/itech32.c -----------*/
trunk/src/mame/includes/vertigo.h
r18112r18113
111111   virtual void machine_start();
112112   virtual void machine_reset();
113113   INTERRUPT_GEN_MEMBER(vertigo_interrupt);
114   TIMER_CALLBACK_MEMBER(sound_command_w);
114115};
115116
116117/*----------- defined in machine/vertigo.c -----------*/
trunk/src/mame/includes/midzeus.h
r18112r18113
5959   UINT32 screen_update_midzeus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6060   UINT32 screen_update_midzeus2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
6161   INTERRUPT_GEN_MEMBER(display_irq);
62   TIMER_CALLBACK_MEMBER(display_irq_off);
63   TIMER_CALLBACK_MEMBER(invasn_gun_callback);
6264};
6365
6466/*----------- defined in video/midzeus2.c -----------*/
trunk/src/mame/includes/gaelco3d.h
r18112r18113
117117   DECLARE_MACHINE_RESET(common);
118118   UINT32 screen_update_gaelco3d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
119119   INTERRUPT_GEN_MEMBER(vblank_gen);
120   TIMER_CALLBACK_MEMBER(delayed_sound_w);
120121};
121122
122123/*----------- defined in video/gaelco3d.c -----------*/
trunk/src/mame/includes/dday.h
r18112r18113
5151   virtual void video_start();
5252   virtual void palette_init();
5353   UINT32 screen_update_dday(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
54   TIMER_CALLBACK_MEMBER(countdown_timer_callback);
5455};
trunk/src/mame/includes/grchamp.h
r18112r18113
7474   UINT32 screen_update_grchamp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7575   INTERRUPT_GEN_MEMBER(grchamp_cpu0_interrupt);
7676   INTERRUPT_GEN_MEMBER(grchamp_cpu1_interrupt);
77   TIMER_CALLBACK_MEMBER(main_to_sub_comm_sync_w);
7778};
7879
7980/* Discrete Sound Input Nodes */
trunk/src/mame/includes/hyprduel.h
r18112r18113
9090   DECLARE_VIDEO_START(magerror_14220);
9191   DECLARE_VIDEO_START(common_14220);
9292   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);
9396};
trunk/src/mame/includes/namconb1.h
r18112r18113
7979   UINT32 screen_update_namconb2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8080   INTERRUPT_GEN_MEMBER(namconb1_interrupt);
8181   INTERRUPT_GEN_MEMBER(namconb2_interrupt);
82   TIMER_CALLBACK_MEMBER(namconb1_TriggerPOSIRQ);
83   TIMER_CALLBACK_MEMBER(namconb2_TriggerPOSIRQ);
8284};
trunk/src/mame/includes/tx1.h
r18112r18113
178178   void screen_eof_tx1(screen_device &screen, bool state);
179179   void screen_eof_buggyboy(screen_device &screen, bool state);
180180   INTERRUPT_GEN_MEMBER(z80_irq);
181   TIMER_CALLBACK_MEMBER(interrupt_callback);
181182};
182183
183184/*----------- defined in audio/tx1.c -----------*/
trunk/src/mame/includes/mhavoc.h
r18112r18113
6262   DECLARE_DRIVER_INIT(mhavocrv);
6363   virtual void machine_start();
6464   virtual void machine_reset();
65   TIMER_CALLBACK_MEMBER(delayed_gamma_w);
6566};
6667
6768/*----------- defined in machine/mhavoc.c -----------*/
trunk/src/mame/includes/sprint4.h
r18112r18113
4040   virtual void palette_init();
4141   UINT32 screen_update_sprint4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4242   void screen_eof_sprint4(screen_device &screen, bool state);
43   TIMER_CALLBACK_MEMBER(nmi_callback);
4344};
trunk/src/mame/includes/exterm.h
r18112r18113
3535   DECLARE_WRITE8_MEMBER(ym2151_data_latch_w);
3636   DECLARE_WRITE8_MEMBER(sound_slave_dac_w);
3737   virtual void palette_init();
38   TIMER_CALLBACK_MEMBER(sound_delayed_w);
3839};
3940
4041/*----------- defined in video/exterm.c -----------*/
trunk/src/mame/includes/m72.h
r18112r18113
119119   UINT32 screen_update_majtitle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
120120   INTERRUPT_GEN_MEMBER(m72_mcu_int);
121121   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);
122126};
trunk/src/mame/includes/segag80r.h
r18112r18113
101101   UINT32 screen_update_segag80r(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
102102   INTERRUPT_GEN_MEMBER(segag80r_vblank_start);
103103   INTERRUPT_GEN_MEMBER(sindbadm_vblank_start);
104   TIMER_CALLBACK_MEMBER(vblank_latch_clear);
104105};
105106
106107
trunk/src/mame/includes/gaplus.h
r18112r18113
5050   INTERRUPT_GEN_MEMBER(gaplus_vblank_main_irq);
5151   INTERRUPT_GEN_MEMBER(gaplus_vblank_sub_irq);
5252   INTERRUPT_GEN_MEMBER(gaplus_vblank_sub2_irq);
53   TIMER_CALLBACK_MEMBER(namcoio_run);
5354};
trunk/src/mame/includes/tehkanwc.h
r18112r18113
4747   TILE_GET_INFO_MEMBER(get_fg_tile_info);
4848   virtual void video_start();
4949   UINT32 screen_update_tehkanwc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
50   TIMER_CALLBACK_MEMBER(reset_callback);
5051};
trunk/src/mame/includes/asuka.h
r18112r18113
5151   UINT32 screen_update_asuka(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5252   void screen_eof_asuka(screen_device &screen, bool state);
5353   INTERRUPT_GEN_MEMBER(cadash_interrupt);
54   TIMER_CALLBACK_MEMBER(cadash_interrupt5);
5455};
5556
5657/*----------- defined in machine/bonzeadv.c -----------*/
trunk/src/mame/includes/suprridr.h
r18112r18113
4242   virtual void palette_init();
4343   UINT32 screen_update_suprridr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4444   INTERRUPT_GEN_MEMBER(main_nmi_gen);
45   TIMER_CALLBACK_MEMBER(delayed_sound_w);
4546};
4647
4748/*----------- defined in video/suprridr.c -----------*/
trunk/src/mame/includes/taito_b.h
r18112r18113
8484   INTERRUPT_GEN_MEMBER(selfeena_interrupt);
8585   INTERRUPT_GEN_MEMBER(sbm_interrupt);
8686   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);
8798};
trunk/src/mame/includes/gameplan.h
r18112r18113
7171   UINT32 screen_update_gameplan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7272   UINT32 screen_update_leprechn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7373   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);
7477};
7578
7679/*----------- defined in video/gameplan.c -----------*/
trunk/src/mame/includes/qdrmfgp.h
r18112r18113
4040   DECLARE_VIDEO_START(qdrmfgp2);
4141   UINT32 screen_update_qdrmfgp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4242   INTERRUPT_GEN_MEMBER(qdrmfgp2_interrupt);
43   TIMER_CALLBACK_MEMBER(gp2_timer_callback);
4344};
4445
4546/*----------- defined in video/qdrmfgp.c -----------*/
trunk/src/mame/includes/skullxbo.h
r18112r18113
2121   DECLARE_MACHINE_RESET(skullxbo);
2222   DECLARE_VIDEO_START(skullxbo);
2323   UINT32 screen_update_skullxbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
24   TIMER_CALLBACK_MEMBER(irq_gen);
2425};
2526
2627/*----------- defined in video/skullxbo.c -----------*/
trunk/src/mame/includes/toaplan2.h
r18112r18113
131131   INTERRUPT_GEN_MEMBER(toaplan2_vblank_irq2);
132132   INTERRUPT_GEN_MEMBER(toaplan2_vblank_irq4);
133133   INTERRUPT_GEN_MEMBER(bbakraid_snd_interrupt);
134   TIMER_CALLBACK_MEMBER(toaplan2_raise_irq);
134135};
trunk/src/mame/includes/lethalj.h
r18112r18113
2929   DECLARE_DRIVER_INIT(ripribit);
3030   DECLARE_DRIVER_INIT(cclownz);
3131   virtual void video_start();
32   TIMER_CALLBACK_MEMBER(gen_ext1_int);
3233};
3334
3435/*----------- defined in video/lethalj.c -----------*/
trunk/src/mame/includes/fgoal.h
r18112r18113
4747   virtual void video_start();
4848   virtual void palette_init();
4949   UINT32 screen_update_fgoal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
50   TIMER_CALLBACK_MEMBER(interrupt_callback);
5051};
trunk/src/mame/includes/tankbust.h
r18112r18113
4444   virtual void palette_init();
4545   UINT32 screen_update_tankbust(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4646   INTERRUPT_GEN_MEMBER(vblank_irq);
47   TIMER_CALLBACK_MEMBER(soundlatch_callback);
48   TIMER_CALLBACK_MEMBER(soundirqline_callback);
4749};
trunk/src/mame/includes/flstory.h
r18112r18113
117117   UINT32 screen_update_flstory(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
118118   UINT32 screen_update_victnine(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
119119   UINT32 screen_update_rumba(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
120   TIMER_CALLBACK_MEMBER(nmi_callback);
120121};
trunk/src/mame/includes/galastrm.h
r18112r18113
4949   virtual void video_start();
5050   UINT32 screen_update_galastrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5151   INTERRUPT_GEN_MEMBER(galastrm_interrupt);
52   TIMER_CALLBACK_MEMBER(galastrm_interrupt6);
5253};
trunk/src/mame/includes/atetris.h
r18112r18113
3232   virtual void machine_reset();
3333   virtual void video_start();
3434   UINT32 screen_update_atetris(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
35   TIMER_CALLBACK_MEMBER(interrupt_gen);
3536};
trunk/src/mame/includes/tetrisp2.h
r18112r18113
110110   UINT32 screen_update_rockntread(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
111111   UINT32 screen_update_rocknms_left(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
112112   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);
113117};
114118
115119class stepstag_state : public tetrisp2_state
trunk/src/mame/includes/starfire.h
r18112r18113
4444   DECLARE_DRIVER_INIT(fireone);
4545   virtual void video_start();
4646   UINT32 screen_update_starfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
47   TIMER_CALLBACK_MEMBER(starfire_scanline_callback);
4748};
trunk/src/mame/includes/sslam.h
r18112r18113
5252   DECLARE_VIDEO_START(powerbls);
5353   UINT32 screen_update_sslam(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5454   UINT32 screen_update_powerbls(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
55   TIMER_CALLBACK_MEMBER(music_playback);
5556};
trunk/src/mame/includes/namcos22.h
r18112r18113
258258   UINT32 screen_update_namcos22(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
259259   INTERRUPT_GEN_MEMBER(namcos22s_interrupt);
260260   INTERRUPT_GEN_MEMBER(namcos22_interrupt);
261   TIMER_CALLBACK_MEMBER(alpine_steplock_callback);
261262};
262263
263264/*----------- defined in video/namcos22.c -----------*/
trunk/src/mame/includes/galaxold.h
r18112r18113
180180   UINT32 screen_update_dambustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
181181   INTERRUPT_GEN_MEMBER(vblank_irq);
182182   INTERRUPT_GEN_MEMBER(hunchbks_vh_interrupt);
183   TIMER_CALLBACK_MEMBER(stars_blink_callback);
184   TIMER_CALLBACK_MEMBER(stars_scroll_callback);
183185};
184186
185187/*----------- defined in video/galaxold.c -----------*/
trunk/src/mame/includes/cave.h
r18112r18113
202202   DECLARE_PALETTE_INIT(sailormn);
203203   UINT32 screen_update_cave(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
204204   INTERRUPT_GEN_MEMBER(cave_interrupt);
205   TIMER_CALLBACK_MEMBER(cave_vblank_end);
205206};
206207
207208/*----------- defined in video/cave.c -----------*/
trunk/src/mame/includes/orbit.h
r18112r18113
4545   virtual void video_start();
4646   UINT32 screen_update_orbit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4747   INTERRUPT_GEN_MEMBER(orbit_interrupt);
48   TIMER_CALLBACK_MEMBER(irq_off);
4849};
4950/*----------- defined in audio/orbit.c -----------*/
5051DECLARE_WRITE8_DEVICE_HANDLER( orbit_note_w );
trunk/src/mame/includes/dec8.h
r18112r18113
132132   void screen_eof_dec8(screen_device &screen, bool state);
133133   INTERRUPT_GEN_MEMBER(gondo_interrupt);
134134   INTERRUPT_GEN_MEMBER(oscar_interrupt);
135   TIMER_CALLBACK_MEMBER(dec8_i8751_timer_callback);
135136};
136137
137138/*----------- defined in video/dec8.c -----------*/
trunk/src/mame/includes/midvunit.h
r18112r18113
120120   virtual void video_start();
121121   DECLARE_MACHINE_RESET(midvplus);
122122   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);
123125};
trunk/src/mame/includes/pitnrun.h
r18112r18113
5353   virtual void palette_init();
5454   UINT32 screen_update_pitnrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5555   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);
5660};
trunk/src/mame/includes/n64.h
r18112r18113
7575   DECLARE_WRITE32_MEMBER( dd_reg_w );
7676   DECLARE_READ32_MEMBER( pif_ram_r );
7777   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);
7882
7983   UINT32 sp_reg_r(UINT32 offset);
8084   void sp_reg_w(UINT32 offset, UINT32 data, UINT32 mem_mask);
trunk/src/mame/includes/bigevglf.h
r18112r18113
9090   virtual void machine_reset();
9191   virtual void video_start();
9292   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);
9396};
trunk/src/mame/includes/capbowl.h
r18112r18113
4242   virtual void video_start();
4343   UINT32 screen_update_capbowl(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
4444   INTERRUPT_GEN_MEMBER(capbowl_interrupt);
45   TIMER_CALLBACK_MEMBER(capbowl_update);
4546};
trunk/src/mame/includes/moo.h
r18112r18113
5656   UINT32 screen_update_moo(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
5757   INTERRUPT_GEN_MEMBER(moo_interrupt);
5858   INTERRUPT_GEN_MEMBER(moobl_interrupt);
59   TIMER_CALLBACK_MEMBER(dmaend_callback);
5960};
6061
6162/*----------- defined in video/moo.c -----------*/
trunk/src/mame/includes/atarisy2.h
r18112r18113
8080   DECLARE_VIDEO_START(atarisy2);
8181   UINT32 screen_update_atarisy2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8282   INTERRUPT_GEN_MEMBER(vblank_int);
83   TIMER_CALLBACK_MEMBER(delayed_int_enable_w);
84   TIMER_CALLBACK_MEMBER(reset_yscroll_callback);
8385};
8486
8587
trunk/src/mame/includes/m92.h
r18112r18113
7777   DECLARE_VIDEO_START(ppan);
7878   UINT32 screen_update_m92(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7979   UINT32 screen_update_ppan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
80   TIMER_CALLBACK_MEMBER(spritebuffer_callback);
8081};
8182
8283/*----------- defined in drivers/m92.c -----------*/
trunk/src/mame/includes/amiga.h
r18112r18113
436436   DECLARE_VIDEO_START(amiga_aga);
437437   UINT32 screen_update_amiga(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
438438   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);
439443};
440444
441445
trunk/src/mame/includes/nbmj8891.h
r18112r18113
7474   virtual void video_start();
7575   DECLARE_VIDEO_START(nbmj8891_1layer);
7676   UINT32 screen_update_nbmj8891(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
77   TIMER_CALLBACK_MEMBER(blitter_timer_callback);
7778};
trunk/src/mame/includes/lkage.h
r18112r18113
8383   virtual void machine_reset();
8484   virtual void video_start();
8585   UINT32 screen_update_lkage(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
86   TIMER_CALLBACK_MEMBER(nmi_callback);
8687};
trunk/src/mame/includes/itech8.h
r18112r18113
9595   UINT32 screen_update_itech8_2page(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
9696   UINT32 screen_update_itech8_2page_large(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
9797   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);
98102};
99103
100104
trunk/src/mame/includes/pastelg.h
r18112r18113
3535   virtual void video_start();
3636   virtual void palette_init();
3737   UINT32 screen_update_pastelg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
38   TIMER_CALLBACK_MEMBER(blitter_timer_callback);
3839};
3940
4041/*----------- defined in video/pastelg.c -----------*/
trunk/src/mame/includes/mcr.h
r18112r18113
101101   DECLARE_VIDEO_START(mcr);
102102   DECLARE_MACHINE_START(nflfoot);
103103   UINT32 screen_update_mcr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
104   TIMER_CALLBACK_MEMBER(ipu_watchdog_reset);
104105};
105106
106107
trunk/src/mame/includes/vicdual.h
r18112r18113
7878   UINT32 screen_update_vicdual_bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7979   UINT32 screen_update_vicdual_bw_or_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
8080   UINT32 screen_update_vicdual_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
81   TIMER_CALLBACK_MEMBER(clear_coin_status);
8182};
8283
8384/*----------- defined in drivers/vicdual.c -----------*/
trunk/src/mame/includes/leland.h
r18112r18113
143143   UINT32 screen_update_leland(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
144144   UINT32 screen_update_ataxx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
145145   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);
146150};
147151
148152
trunk/src/mame/includes/dkong.h
r18112r18113
217217   UINT32 screen_update_spclforc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
218218   INTERRUPT_GEN_MEMBER(s2650_interrupt);
219219   INTERRUPT_GEN_MEMBER(vblank_irq);
220   TIMER_CALLBACK_MEMBER(scanline_callback);
220221};
221222
222223/*----------- defined in audio/dkong.c -----------*/
trunk/src/mame/includes/sprint8.h
r18112r18113
3737   virtual void palette_init();
3838   UINT32 screen_update_sprint8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3939   void screen_eof_sprint8(screen_device &screen, bool state);
40   TIMER_CALLBACK_MEMBER(sprint8_collision_callback);
4041};
4142
4243/*----------- defined in drivers/sprint8.c -----------*/
trunk/src/mame/includes/bombjack.h
r18112r18113
4141   virtual void video_start();
4242   UINT32 screen_update_bombjack(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4343   INTERRUPT_GEN_MEMBER(vblank_irq);
44   TIMER_CALLBACK_MEMBER(soundlatch_callback);
4445};
trunk/src/mame/includes/gcpinbal.h
r18112r18113
6060   virtual void video_start();
6161   UINT32 screen_update_gcpinbal(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6262   INTERRUPT_GEN_MEMBER(gcpinbal_interrupt);
63   TIMER_CALLBACK_MEMBER(gcpinbal_interrupt1);
64   TIMER_CALLBACK_MEMBER(gcpinbal_interrupt3);
6365};
trunk/src/mame/includes/astrocde.h
r18112r18113
122122   DECLARE_PALETTE_INIT(profpac);
123123   UINT32 screen_update_astrocde(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
124124   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);
125127};
126128
127129/*----------- defined in audio/wow.c -----------*/
trunk/src/mame/includes/jedi.h
r18112r18113
7777   virtual void machine_reset();
7878   DECLARE_VIDEO_START(jedi);
7979   UINT32 screen_update_jedi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
80   TIMER_CALLBACK_MEMBER(generate_interrupt);
8081};
8182
8283/*----------- defined in audio/jedi.c -----------*/
trunk/src/mame/includes/psikyo.h
r18112r18113
9292   UINT32 screen_update_psikyo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
9393   UINT32 screen_update_psikyo_bootleg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
9494   void screen_eof_psikyo(screen_device &screen, bool state);
95   TIMER_CALLBACK_MEMBER(psikyo_soundlatch_callback);
9596};
9697
9798/*----------- defined in video/psikyo.c -----------*/
trunk/src/mame/includes/model3.h
r18112r18113
198198   DECLARE_MACHINE_START(model3_21);
199199   DECLARE_MACHINE_RESET(model3_21);
200200   UINT32 screen_update_model3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
201   TIMER_CALLBACK_MEMBER(model3_sound_timer_tick);
201202};
202203
203204
trunk/src/mame/includes/nbmj8688.h
r18112r18113
9090   UINT32 screen_update_mbmj8688(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
9191   UINT32 screen_update_mbmj8688_lcd0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
9292   UINT32 screen_update_mbmj8688_lcd1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
93   TIMER_CALLBACK_MEMBER(blitter_timer_callback);
9394};
trunk/src/mame/includes/tank8.h
r18112r18113
6161   virtual void palette_init();
6262   UINT32 screen_update_tank8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6363   void screen_eof_tank8(screen_device &screen, bool state);
64   TIMER_CALLBACK_MEMBER(tank8_collision_callback);
6465};
6566
6667/*----------- defined in audio/tank8.c -----------*/
trunk/src/mame/includes/othunder.h
r18112r18113
6464   virtual void video_start();
6565   UINT32 screen_update_othunder(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6666   INTERRUPT_GEN_MEMBER(vblank_interrupt);
67   TIMER_CALLBACK_MEMBER(ad_interrupt);
6768};
trunk/src/mame/includes/m10.h
r18112r18113
9191   INTERRUPT_GEN_MEMBER(m11_interrupt);
9292   INTERRUPT_GEN_MEMBER(m10_interrupt);
9393   INTERRUPT_GEN_MEMBER(m15_interrupt);
94   TIMER_CALLBACK_MEMBER(interrupt_callback);
9495};
9596
trunk/src/mame/includes/slapshot.h
r18112r18113
6767   UINT32 screen_update_slapshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6868   void screen_eof_taito_no_buffer(screen_device &screen, bool state);
6969   INTERRUPT_GEN_MEMBER(slapshot_interrupt);
70   TIMER_CALLBACK_MEMBER(slapshot_interrupt6);
7071};
7172
trunk/src/mame/includes/cchasm.h
r18112r18113
3232   INPUT_CHANGED_MEMBER(cchasm_set_coin_flag);
3333   DECLARE_WRITE_LINE_MEMBER(cchasm_6840_irq);
3434   virtual void video_start();
35   TIMER_CALLBACK_MEMBER(cchasm_refresh_end);
3536};
3637
3738/*----------- defined in audio/cchasm.c -----------*/
trunk/src/mame/includes/spacefb.h
r18112r18113
5050   virtual void machine_reset();
5151   virtual void video_start();
5252   UINT32 screen_update_spacefb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
53   TIMER_CALLBACK_MEMBER(interrupt_callback);
5354};
5455
5556/*----------- defined in audio/spacefb.c -----------*/
trunk/src/mame/includes/ladyfrog.h
r18112r18113
5959   DECLARE_VIDEO_START(toucheme);
6060   DECLARE_VIDEO_START(ladyfrog_common);
6161   UINT32 screen_update_ladyfrog(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
62   TIMER_CALLBACK_MEMBER(nmi_callback);
6263};
trunk/src/mame/includes/esripsys.h
r18112r18113
9494   virtual void video_start();
9595   UINT32 screen_update_esripsys(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
9696   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);
97100};
98101
99102
trunk/src/mame/includes/nbmj8991.h
r18112r18113
5353   virtual void video_start();
5454   UINT32 screen_update_nbmj8991_type1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5555   UINT32 screen_update_nbmj8991_type2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
56   TIMER_CALLBACK_MEMBER(blitter_timer_callback);
5657};
trunk/src/mame/includes/exidy440.h
r18112r18113
7070   UINT32 screen_update_exidy440(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7171   UINT32 screen_update_topsecex(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7272   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);
7376};
7477
7578
trunk/src/mame/includes/blstroid.h
r18112r18113
2222   DECLARE_MACHINE_RESET(blstroid);
2323   DECLARE_VIDEO_START(blstroid);
2424   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);
2527};
2628
2729
trunk/src/mame/includes/harddriv.h
r18112r18113
218218   DECLARE_MACHINE_RESET(harddriv);
219219   DECLARE_VIDEO_START(harddriv);
220220   INTERRUPT_GEN_MEMBER(hd68k_irq_gen);
221   TIMER_CALLBACK_MEMBER(deferred_adsp_bank_switch);
222   TIMER_CALLBACK_MEMBER(rddsp32_sync_cb);
221223};
222224
223225
trunk/src/mame/includes/trucocl.h
r18112r18113
2323   virtual void palette_init();
2424   UINT32 screen_update_trucocl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
2525   INTERRUPT_GEN_MEMBER(trucocl_interrupt);
26   TIMER_CALLBACK_MEMBER(dac_irq);
2627};
trunk/src/mame/includes/gridlee.h
r18112r18113
5656   virtual void video_start();
5757   virtual void palette_init();
5858   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);
5963};
6064
6165
trunk/src/mame/includes/topspeed.h
r18112r18113
5757   UINT32 screen_update_topspeed(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5858   INTERRUPT_GEN_MEMBER(topspeed_interrupt);
5959   INTERRUPT_GEN_MEMBER(topspeed_cpub_interrupt);
60   TIMER_CALLBACK_MEMBER(topspeed_interrupt6);
61   TIMER_CALLBACK_MEMBER(topspeed_cpub_interrupt6);
6062};
trunk/src/mame/includes/thunderx.h
r18112r18113
5252   DECLARE_MACHINE_RESET(thunderx);
5353   UINT32 screen_update_scontra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5454   INTERRUPT_GEN_MEMBER(scontra_interrupt);
55   TIMER_CALLBACK_MEMBER(thunderx_firq_callback);
5556};
5657
5758
trunk/src/mame/includes/opwolf.h
r18112r18113
7373   virtual void machine_start();
7474   DECLARE_MACHINE_RESET(opwolf);
7575   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);
7678};
7779
7880/*----------- defined in machine/opwolf.c -----------*/
trunk/src/mame/includes/nbmj8900.h
r18112r18113
4545   DECLARE_DRIVER_INIT(ohpaipee);
4646   virtual void video_start();
4747   UINT32 screen_update_nbmj8900(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
48   TIMER_CALLBACK_MEMBER(blitter_timer_callback);
4849};
trunk/src/mame/includes/videopin.h
r18112r18113
4242   virtual void machine_reset();
4343   virtual void video_start();
4444   UINT32 screen_update_videopin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
45   TIMER_CALLBACK_MEMBER(interrupt_callback);
4546};
4647
4748/*----------- defined in audio/videopin.c -----------*/
trunk/src/mame/includes/victory.h
r18112r18113
6363   virtual void video_start();
6464   UINT32 screen_update_victory(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6565   INTERRUPT_GEN_MEMBER(victory_vblank_interrupt);
66   TIMER_CALLBACK_MEMBER(bgcoll_irq_callback);
6667};
trunk/src/mame/includes/xexex.h
r18112r18113
6565   virtual void machine_reset();
6666   virtual void video_start();
6767   UINT32 screen_update_xexex(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
68   TIMER_CALLBACK_MEMBER(dmaend_callback);
6869};
6970
7071/*----------- defined in video/xexex.c -----------*/
trunk/src/mame/includes/ultratnk.h
r18112r18113
4141   virtual void palette_init();
4242   UINT32 screen_update_ultratnk(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4343   void screen_eof_ultratnk(screen_device &screen, bool state);
44   TIMER_CALLBACK_MEMBER(nmi_callback);
4445};
trunk/src/mame/includes/gunbustr.h
r18112r18113
4141   virtual void video_start();
4242   UINT32 screen_update_gunbustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4343   INTERRUPT_GEN_MEMBER(gunbustr_interrupt);
44   TIMER_CALLBACK_MEMBER(gunbustr_interrupt5);
4445};
trunk/src/mame/includes/taitosj.h
r18112r18113
9090   virtual void video_start();
9191   UINT32 screen_update_taitosj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
9292   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);
9396};
9497
trunk/src/mame/includes/superqix.h
r18112r18113
8080   UINT32 screen_update_superqix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8181   INTERRUPT_GEN_MEMBER(vblank_irq);
8282   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);
8386};
trunk/src/mame/includes/rltennis.h
r18112r18113
4848   virtual void video_start();
4949   UINT32 screen_update_rltennis(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5050   INTERRUPT_GEN_MEMBER(rltennis_interrupt);
51   TIMER_CALLBACK_MEMBER(sample_player);
5152};
trunk/src/mame/includes/namcos2.h
r18112r18113
181181   INTERRUPT_GEN_MEMBER(namcos2_68k_master_vblank);
182182   INTERRUPT_GEN_MEMBER(namcos2_68k_slave_vblank);
183183   INTERRUPT_GEN_MEMBER(namcos2_68k_gpu_vblank);
184   TIMER_CALLBACK_MEMBER(namcos2_posirq_tick);
184185};
185186
186187class namcos2_state : public namcos2_shared_state
trunk/src/mame/includes/magmax.h
r18112r18113
3434   virtual void video_start();
3535   virtual void palette_init();
3636   UINT32 screen_update_magmax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
37   TIMER_CALLBACK_MEMBER(scanline_callback);
3738};
trunk/src/mame/includes/fromance.h
r18112r18113
8686   DECLARE_VIDEO_START(hatris);
8787   UINT32 screen_update_fromance(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8888   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);
8991};
trunk/src/mame/includes/mustache.h
r18112r18113
2121   virtual void palette_init();
2222   UINT32 screen_update_mustache(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
2323   INTERRUPT_GEN_MEMBER(assert_irq);
24   TIMER_CALLBACK_MEMBER(clear_irq_cb);
2425};
trunk/src/mame/includes/konamigx.h
r18112r18113
8080   UINT32 screen_update_konamigx_right(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
8181   INTERRUPT_GEN_MEMBER(konamigx_vbinterrupt);
8282   INTERRUPT_GEN_MEMBER(tms_sync);
83   TIMER_CALLBACK_MEMBER(dmaend_callback);
8384};
8485
8586
trunk/src/mame/includes/tmnt.h
r18112r18113
144144   INTERRUPT_GEN_MEMBER(punkshot_interrupt);
145145   INTERRUPT_GEN_MEMBER(lgtnfght_interrupt);
146146   INTERRUPT_GEN_MEMBER(tmnt_vblank_irq);
147   TIMER_CALLBACK_MEMBER(nmi_callback);
147148};
148149
149150
trunk/src/mame/includes/metro.h
r18112r18113
166166   INTERRUPT_GEN_MEMBER(metro_periodic_interrupt);
167167   INTERRUPT_GEN_MEMBER(karatour_interrupt);
168168   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);
169172};
170173
171174
trunk/src/mame/includes/parodius.h
r18112r18113
4444   virtual void machine_reset();
4545   UINT32 screen_update_parodius(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4646   INTERRUPT_GEN_MEMBER(parodius_interrupt);
47   TIMER_CALLBACK_MEMBER(nmi_callback);
4748};
4849
4950/*----------- defined in video/parodius.c -----------*/
trunk/src/mame/video/atarisy2.c
r18112r18113
1717 *
1818 *************************************/
1919
20static TIMER_CALLBACK( reset_yscroll_callback );
2120
2221
2322
23
2424/*************************************
2525 *
2626 *  Tilemap callbacks
r18112r18113
107107   m_alpha_tilemap->set_transparent_pen(0);
108108
109109   /* 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));
111111   m_videobank = 0;
112112
113113   /* save states */
r18112r18113
150150}
151151
152152
153static TIMER_CALLBACK( reset_yscroll_callback )
153TIMER_CALLBACK_MEMBER(atarisy2_state::reset_yscroll_callback)
154154{
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);
157156}
158157
159158
trunk/src/mame/video/m92.c
r18112r18113
4444
4545/*****************************************************************************/
4646
47static TIMER_CALLBACK( spritebuffer_callback )
47TIMER_CALLBACK_MEMBER(m92_state::spritebuffer_callback)
4848{
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());
5352}
5453
5554WRITE16_MEMBER(m92_state::m92_spritecontrol_w)
r18112r18113
8281
8382      /* Pixel clock is 26.6666MHz (some boards 27MHz??), we have 0x800 bytes, or 0x400 words to copy from
8483        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));
8685   }
8786//  logerror("%04x: m92_spritecontrol_w %08x %08x\n",space.device().safe_pc(),offset,data);
8887}
trunk/src/mame/video/nbmj8891.c
r18112r18113
312312   state->m_tmpbitmap1.pix16(y, x) = (color == 0x7f) ? 0xff : color;
313313}
314314
315static TIMER_CALLBACK( blitter_timer_callback )
315TIMER_CALLBACK_MEMBER(nbmj8891_state::blitter_timer_callback)
316316{
317317   nb1413m3_busyflag = 1;
318318}
r18112r18113
462462   }
463463
464464   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));
466466}
467467
468468/******************************************************************************
trunk/src/mame/video/itech8.c
r18112r18113
419419 *
420420 *************************************/
421421
422static TIMER_CALLBACK( blitter_done )
422TIMER_CALLBACK_MEMBER(itech8_state::blitter_done)
423423{
424   itech8_state *state = machine.driver_data<itech8_state>();
425424   /* 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);
428427
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());
430429}
431430
432431
r18112r18113
502501      m_blit_in_progress = 1;
503502
504503      /* 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));
506505   }
507506
508507   /* debugging */
trunk/src/mame/video/pastelg.c
r18112r18113
150150   state->m_flipscreen_old = state->m_flipscreen;
151151}
152152
153static TIMER_CALLBACK( blitter_timer_callback )
153TIMER_CALLBACK_MEMBER(pastelg_state::blitter_timer_callback)
154154{
155155   nb1413m3_busyflag = 1;
156156}
r18112r18113
276276   }
277277
278278   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));
280280}
281281
282282/******************************************************************************
trunk/src/mame/video/leland.c
r18112r18113
2727 *
2828 *************************************/
2929
30static TIMER_CALLBACK( scanline_callback )
30TIMER_CALLBACK_MEMBER(leland_state::scanline_callback)
3131{
32   leland_state *state = machine.driver_data<leland_state>();
33   device_t *audio = machine.device("custom");
32   device_t *audio = machine().device("custom");
3433   int scanline = param;
3534
3635   /* 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]);
3938
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]);
4241
43   state->m_last_scanline = scanline;
42   m_last_scanline = scanline;
4443
4544   scanline = (scanline+1) % 256;
4645
4746   /* come back at the next appropriate scanline */
48   state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
47   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
4948}
5049
5150
r18112r18113
6160   m_video_ram = auto_alloc_array_clear(machine(), UINT8, VRAM_SIZE);
6261
6362   /* 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));
6564   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(0));
6665
6766}
r18112r18113
288287}
289288
290289
291static TIMER_CALLBACK( leland_delayed_mvram_w )
290TIMER_CALLBACK_MEMBER(leland_state::leland_delayed_mvram_w)
292291{
293   address_space &space = machine.device("master")->memory().space(AS_PROGRAM);
292   address_space &space = machine().device("master")->memory().space(AS_PROGRAM);
294293
295294   int num = (param >> 16) & 1;
296295   int offset = (param >> 8) & 0xff;
r18112r18113
301300
302301WRITE8_MEMBER(leland_state::leland_mvram_port_w)
303302{
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);
305304}
306305
307306
r18112r18113
346345WRITE8_MEMBER(leland_state::ataxx_mvram_port_w)
347346{
348347   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);
350349}
351350
352351
trunk/src/mame/video/dkong.c
r18112r18113
891891      state->m_counter++;
892892}
893893
894static TIMER_CALLBACK( scanline_callback )
894TIMER_CALLBACK_MEMBER(dkong_state::scanline_callback)
895895{
896   dkong_state *state = machine.driver_data<dkong_state>();
897896   int scanline = param;
898897
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);
901900
902901   /* update any video up to the current scanline */
903   machine.primary_screen->update_now();
902   machine().primary_screen->update_now();
904903
905904   scanline = (scanline+1) % VTOTAL;
906905   /* come back at the next appropriate scanline */
907   state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
906   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
908907}
909908
910909static void check_palette(running_machine &machine)
r18112r18113
958957
959958   VIDEO_START_CALL_MEMBER(dkong_base);
960959
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));
962961   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(0));
963962
964963   switch (m_hardware_type)
trunk/src/mame/video/sprint8.c
r18112r18113
148148}
149149
150150
151static TIMER_CALLBACK( sprint8_collision_callback )
151TIMER_CALLBACK_MEMBER(sprint8_state::sprint8_collision_callback)
152152{
153   sprint8_set_collision(machine, param);
153   sprint8_set_collision(machine(), param);
154154}
155155
156156
r18112r18113
186186         for (x = visarea.min_x; x <= visarea.max_x; x++)
187187            if (p1[x] != 0x20 && p2[x] == 0x23)
188188               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),
190190                     colortable_entry_get_value(machine().colortable, p1[x]));
191191      }
192192   }
trunk/src/mame/video/astrocde.c
r18112r18113
3131 *************************************/
3232
3333static void init_savestate(running_machine &machine);
34static TIMER_CALLBACK( scanline_callback );
35static TIMER_CALLBACK( interrupt_off );
34
35
3636static void init_sparklestar(running_machine &machine);
3737
3838
r18112r18113
164164{
165165
166166   /* 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));
168168   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));
170170
171171   /* register for save states */
172172   init_savestate(machine());
r18112r18113
181181{
182182
183183   /* 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));
185185   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));
187187
188188   /* allocate videoram */
189189   m_profpac_videoram = auto_alloc_array(machine(), UINT16, 0x4000 * 4);
r18112r18113
373373 *
374374 *************************************/
375375
376static TIMER_CALLBACK( interrupt_off )
376TIMER_CALLBACK_MEMBER(astrocde_state::interrupt_off)
377377{
378   machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
378   machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
379379}
380380
381381
r18112r18113
414414 *
415415 *************************************/
416416
417static TIMER_CALLBACK( scanline_callback )
417TIMER_CALLBACK_MEMBER(astrocde_state::scanline_callback)
418418{
419   astrocde_state *state = machine.driver_data<astrocde_state>();
420419   int scanline = param;
421420   int astrocade_scanline = mame_vpos_to_astrocade_vpos(scanline);
422421
423422   /* force an update against the current scanline */
424423   if (scanline > 0)
425      machine.primary_screen->update_partial(scanline - 1);
424      machine().primary_screen->update_partial(scanline - 1);
426425
427426   /* generate a scanline interrupt if it's time */
428   if (astrocade_scanline == state->m_interrupt_scanline && (state->m_interrupt_enabl & 0x08) != 0)
427   if (astrocade_scanline == m_interrupt_scanline && (m_interrupt_enabl & 0x08) != 0)
429428   {
430429      /* bit 2 controls the interrupt mode: mode 0 means assert until acknowledged */
431      if ((state->m_interrupt_enabl & 0x04) == 0)
430      if ((m_interrupt_enabl & 0x04) == 0)
432431      {
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));
435434      }
436435
437436      /* mode 1 means assert for 1 instruction */
438437      else
439438      {
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));
442441      }
443442   }
444443
445444   /* 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);
448447
449448   /* advance to the next scanline */
450449   scanline++;
451   if (scanline >= machine.primary_screen->height())
450   if (scanline >= machine().primary_screen->height())
452451      scanline = 0;
453   state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
452   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
454453}
455454
456455
trunk/src/mame/video/nbmj8688.c
r18112r18113
266266   update_pixel(state, x, y);
267267}
268268
269static TIMER_CALLBACK( blitter_timer_callback )
269TIMER_CALLBACK_MEMBER(nbmj8688_state::blitter_timer_callback)
270270{
271271   nb1413m3_busyflag = 1;
272272}
r18112r18113
525525   nb1413m3_busyflag = 0;
526526
527527   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));
529529   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));
531531}
532532
533533
trunk/src/mame/video/tank8.c
r18112r18113
168168}
169169
170170
171static TIMER_CALLBACK( tank8_collision_callback )
171TIMER_CALLBACK_MEMBER(tank8_state::tank8_collision_callback)
172172{
173   tank8_set_collision(machine, param);
173   tank8_set_collision(machine(), param);
174174}
175175
176176
r18112r18113
269269                  index |= 0x80; /* collision on right side */
270270            }
271271
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);
273273
274274            _state = 1;
275275         }
trunk/src/mame/video/cchasm.c
r18112r18113
1919
2020
2121
22static TIMER_CALLBACK( cchasm_refresh_end )
22TIMER_CALLBACK_MEMBER(cchasm_state::cchasm_refresh_end)
2323{
24    machine.device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
24    machine().device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
2525}
2626
2727static void cchasm_refresh (running_machine &machine)
r18112r18113
9999      }
100100   }
101101    /* 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));
103103}
104104
105105
trunk/src/mame/video/esripsys.c
r18112r18113
1515   m_frame_vbl = 0;
1616}
1717
18static TIMER_CALLBACK( hblank_start_callback )
18TIMER_CALLBACK_MEMBER(esripsys_state::hblank_start_callback)
1919{
20   esripsys_state *state = machine.driver_data<esripsys_state>();
21   int v = machine.primary_screen->vpos();
20   int v = machine().primary_screen->vpos();
2221
23   if (state->m_video_firq)
22   if (m_video_firq)
2423   {
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);
2726   }
2827
2928   /* Not sure if this is totally accurate - I couldn't find the circuit that generates the FIRQs! */
30   if (!(v % 6) && v && state->m_video_firq_en && v < ESRIPSYS_VBLANK_START)
29   if (!(v % 6) && v && m_video_firq_en && v < ESRIPSYS_VBLANK_START)
3130   {
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);
3433   }
3534
3635   /* Adjust for next scanline */
r18112r18113
3837      v = 0;
3938
4039   /* 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;
4342}
4443
45static TIMER_CALLBACK( hblank_end_callback )
44TIMER_CALLBACK_MEMBER(esripsys_state::hblank_end_callback)
4645{
47   esripsys_state *state = machine.driver_data<esripsys_state>();
48   int v = machine.primary_screen->vpos();
46   int v = machine().primary_screen->vpos();
4947
5048   if (v > 0)
51      machine.primary_screen->update_partial(v - 1);
49      machine().primary_screen->update_partial(v - 1);
5250
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));
5553
56   state->m_hblank = 1;
54   m_hblank = 1;
5755}
5856
5957void esripsys_state::video_start()
r18112r18113
7169   line_buffer[1].priority_buf = auto_alloc_array(machine(), UINT8, 512);
7270
7371   /* 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));
7674   m_hblank_start_timer->adjust(machine().primary_screen->time_until_pos(0, ESRIPSYS_HBLANK_START));
7775
7876   /* Create the sprite scaling table */
trunk/src/mame/video/nbmj8991.c
r18112r18113
172172   state->m_tmpbitmap.pix16(y, x) = color;
173173}
174174
175static TIMER_CALLBACK( blitter_timer_callback )
175TIMER_CALLBACK_MEMBER(nbmj8991_state::blitter_timer_callback)
176176{
177177   nb1413m3_busyflag = 1;
178178}
r18112r18113
280280   }
281281
282282   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));
284284}
285285
286286/******************************************************************************
trunk/src/mame/video/exidy440.c
r18112r18113
248248 *
249249 *************************************/
250250
251static TIMER_CALLBACK( beam_firq_callback )
251TIMER_CALLBACK_MEMBER(exidy440_state::beam_firq_callback)
252252{
253   exidy440_state *state = machine.driver_data<exidy440_state>();
254253   /* generate the interrupt, if we're selected */
255   if (state->m_firq_select && state->m_firq_enable)
254   if (m_firq_select && m_firq_enable)
256255   {
257      state->m_firq_beam = 1;
258      exidy440_update_firq(machine);
256      m_firq_beam = 1;
257      exidy440_update_firq(machine());
259258   }
260259
261260   /* round the x value to the nearest byte */
262261   param = (param + 1) / 2;
263262
264263   /* latch the x value; this convolution comes from the read routine */
265   state->m_latched_x = (param + 3) ^ 2;
264   m_latched_x = (param + 3) ^ 2;
266265}
267266
268267
269static TIMER_CALLBACK( collide_firq_callback )
268TIMER_CALLBACK_MEMBER(exidy440_state::collide_firq_callback)
270269{
271   exidy440_state *state = machine.driver_data<exidy440_state>();
272270   /* generate the interrupt, if we're selected */
273   if (!state->m_firq_select && state->m_firq_enable)
271   if (!m_firq_select && m_firq_enable)
274272   {
275      state->m_firq_beam = 1;
276      exidy440_update_firq(machine);
273      m_firq_beam = 1;
274      exidy440_update_firq(machine());
277275   }
278276
279277   /* round the x value to the nearest byte */
280278   param = (param + 1) / 2;
281279
282280   /* latch the x value; this convolution comes from the read routine */
283   state->m_latched_x = (param + 3) ^ 2;
281   m_latched_x = (param + 3) ^ 2;
284282}
285283
286284
r18112r18113
360358
361359                  /* check the collisions bit */
362360                  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);
364362               }
365363               currx++;
366364
r18112r18113
373371
374372                  /* check the collisions bit */
375373                  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);
377375               }
378376               currx++;
379377            }
r18112r18113
445443      attotime time = screen.time_until_pos(beamy, beamx) - increment * 6;
446444      for (i = 0; i <= 12; i++)
447445      {
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);
449447         time += increment;
450448      }
451449   }
trunk/src/mame/video/blstroid.c
r18112r18113
8787 *
8888 *************************************/
8989
90static TIMER_CALLBACK( irq_off )
90TIMER_CALLBACK_MEMBER(blstroid_state::irq_off)
9191{
92   address_space &space = machine.device("maincpu")->memory().space(AS_PROGRAM);
92   address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
9393
9494   /* clear the interrupt */
9595   atarigen_scanline_int_ack_w(space, 0, 0, 0xffff);
9696}
9797
9898
99static TIMER_CALLBACK( irq_on )
99TIMER_CALLBACK_MEMBER(blstroid_state::irq_on)
100100{
101101   /* 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());
104104}
105105
106106
r18112r18113
129129         period_on  = screen.time_until_pos(vpos + 7, width * 0.9);
130130         period_off = screen.time_until_pos(vpos + 8, width * 0.9);
131131
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));
134134      }
135135}
136136
trunk/src/mame/video/nbmj8900.c
r18112r18113
203203   state->m_tmpbitmap1.pix16(y, x) = machine.pens[color];
204204}
205205
206static TIMER_CALLBACK( blitter_timer_callback )
206TIMER_CALLBACK_MEMBER(nbmj8900_state::blitter_timer_callback)
207207{
208208   nb1413m3_busyflag = 1;
209209}
r18112r18113
357357   }
358358
359359   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));
361361}
362362
363363/******************************************************************************
trunk/src/mame/video/victory.c
r18112r18113
10681068}
10691069
10701070
1071static TIMER_CALLBACK( bgcoll_irq_callback )
1071TIMER_CALLBACK_MEMBER(victory_state::bgcoll_irq_callback)
10721072{
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());
10781077}
10791078
10801079
r18112r18113
11131112         int bpix = bg[(x + m_scrollx) & 255];
11141113         scanline[x] = bpix | (fpix << 3);
11151114         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));
11171116      }
11181117   }
11191118
trunk/src/mame/video/fromance.c
r18112r18113
1111#include "includes/fromance.h"
1212
1313
14static TIMER_CALLBACK( crtc_interrupt_gen );
1514
15
1616/*************************************
1717 *
1818 *  Tilemap callbacks
r18112r18113
7070   state->m_fg_tilemap->set_transparent_pen(15);
7171
7272   /* 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));
7474
7575   /* state save */
7676   state->save_item(NAME(state->m_selected_videoram));
r18112r18113
251251 *
252252 *************************************/
253253
254static TIMER_CALLBACK( crtc_interrupt_gen )
254TIMER_CALLBACK_MEMBER(fromance_state::crtc_interrupt_gen)
255255{
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);
258257   if (param != 0)
259      state->m_crtc_timer->adjust(machine.primary_screen->frame_period() / param, 0, machine.primary_screen->frame_period() / param);
258      m_crtc_timer->adjust(machine().primary_screen->frame_period() / param, 0, machine().primary_screen->frame_period() / param);
260259}
261260
262261
trunk/src/mame/video/n8080.c
r18112r18113
5454}
5555
5656
57static TIMER_CALLBACK( spacefev_stop_red_cannon )
57TIMER_CALLBACK_MEMBER(n8080_state::spacefev_stop_red_cannon)
5858{
59   n8080_state *state = machine.driver_data<n8080_state>();
6059
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);
6362}
6463
6564
r18112r18113
9190VIDEO_START_MEMBER(n8080_state,spacefev)
9291{
9392
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));
9594
9695   flip_screen_set_no_update(0);
9796
trunk/src/mame/video/segas32.c
r18112r18113
298298 *
299299 *************************************/
300300
301static TIMER_CALLBACK( update_sprites )
301TIMER_CALLBACK_MEMBER(segas32_state::update_sprites)
302302{
303   segas32_state *state = machine.driver_data<segas32_state>();
304303   /* if automatic mode is selected, do it every frame (0) or every other frame (1) */
305   if (!(state->m_sprite_control[3] & 2))
304   if (!(m_sprite_control[3] & 2))
306305   {
307306      /* if we count down to the start, process the automatic swapping, but only after a short delay */
308      if (state->m_sprite_render_count-- == 0)
307      if (m_sprite_render_count-- == 0)
309308      {
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;
312311      }
313312   }
314313
315314   /* 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)
319318   {
320      sprite_swap_buffers(state);
321      sprite_render_list(machine);
319      sprite_swap_buffers(this);
320      sprite_render_list(machine());
322321   }
323   state->m_sprite_control[0] = 0;
322   m_sprite_control[0] = 0;
324323}
325324
326325
327326void system32_set_vblank(running_machine &machine, int state)
328327{
328   segas32_state *drvstate = machine.driver_data<segas32_state>();
329329   /* at the end of VBLANK is when automatic sprite rendering happens */
330330   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);
332332}
333333
334334
trunk/src/mame/video/vectrex.c
r18112r18113
7171
7272*********************************************************************/
7373
74static TIMER_CALLBACK(lightpen_trigger)
74TIMER_CALLBACK_MEMBER(vectrex_state::lightpen_trigger)
7575{
76   vectrex_state *state = machine.driver_data<vectrex_state>();
77   if (state->m_lightpen_port & 1)
76   if (m_lightpen_port & 1)
7877   {
79      via6522_device *via_0 = machine.device<via6522_device>("via6522_0");
78      via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
8079      via_0->write_ca1(1);
8180      via_0->write_ca1(0);
8281   }
8382
84   if (state->m_lightpen_port & 2)
83   if (m_lightpen_port & 2)
8584   {
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);
8786   }
8887}
8988
r18112r18113
148147
149148*********************************************************************/
150149
151static TIMER_CALLBACK(vectrex_refresh)
150TIMER_CALLBACK_MEMBER(vectrex_state::vectrex_refresh)
152151{
153   vectrex_state *state = machine.driver_data<vectrex_state>();
154152   /* Refresh only marks the range of vectors which will be drawn
155153     * 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;
158156}
159157
160158
r18112r18113
223221}
224222
225223
226static TIMER_CALLBACK(vectrex_zero_integrators)
224TIMER_CALLBACK_MEMBER(vectrex_state::vectrex_zero_integrators)
227225{
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);
232229}
233230
234231
r18112r18113
242239
243240*********************************************************************/
244241
245static TIMER_CALLBACK(update_signal)
242TIMER_CALLBACK_MEMBER(vectrex_state::update_signal)
246243{
247   vectrex_state *state = machine.driver_data<vectrex_state>();
248244   int length;
249245
250   if (!state->m_ramp)
246   if (!m_ramp)
251247   {
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();
254250
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]);
257253
258      (*state->vector_add_point_function)(machine, state->m_x_int, state->m_y_int, state->m_beam_color, 2 * state->m_analog[A_Z] * state->m_blank);
254      (*vector_add_point_function)(machine(), m_x_int, m_y_int, m_beam_color, 2 * m_analog[A_Z] * m_blank);
259255   }
260256   else
261257   {
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]);
264260   }
265261
266   state->m_vector_start_time = machine.time();
262   m_vector_start_time = machine().time();
267263
268264   if (ptr)
269265      * (UINT8 *) ptr = param;
r18112r18113
289285   m_imager_freq = 1;
290286
291287   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));
293289   m_imager_timer->adjust(
294290                    attotime::from_hz(m_imager_freq),
295291                    2,
296292                    attotime::from_hz(m_imager_freq));
297293
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));
299295
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));
301297
302298   VIDEO_START_CALL_LEGACY(vector);
303299}
r18112r18113
314310   vectrex_state *state = machine.driver_data<vectrex_state>();
315311   dac_device *dac = machine.device<dac_device>("dac");
316312
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]);
318314
319315   if (mux == A_AUDIO)
320316      dac->write_unsigned8(state->m_via_out[PORTA]);
r18112r18113
370366      if (!(data & 0x1) && (state->m_via_out[PORTB] & 0x1))
371367      {
372368         /* 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));
374370      }
375371   }
376372   else
r18112r18113
407403      vectrex_multiplexer (space.machine(), (data >> 1) & 0x3);
408404
409405   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);
411407}
412408
413409
r18112r18113
416412   vectrex_state *state = space.machine().driver_data<vectrex_state>();
417413   /* DAC output always goes to Y integrator */
418414   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]);
420416
421417   if (!(state->m_via_out[PORTB] & 0x1))
422418      vectrex_multiplexer (space.machine(), (state->m_via_out[PORTB] >> 1) & 0x3);
r18112r18113
425421
426422static WRITE8_DEVICE_HANDLER(v_via_ca2_w)
427423{
424   vectrex_state *state = space.machine().driver_data<vectrex_state>();
428425   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));
430427}
431428
432429
r18112r18113
451448            dx = abs(state->m_pen_x - state->m_x_int);
452449            dy = abs(state->m_pen_y - state->m_y_int);
453450            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));
455452         }
456453      }
457454
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);
459456      state->m_cb2 = data;
460457   }
461458}
r18112r18113
494491   m_y_max = visarea.max_y << 16;
495492
496493   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));
498495
499496   VIDEO_START_CALL_LEGACY(vector);
500497}
trunk/src/mame/video/changela.c
r18112r18113
1515#include "includes/changela.h"
1616
1717
18static TIMER_CALLBACK( changela_scanline_callback );
1918
19
2020void changela_state::video_start()
2121{
2222
r18112r18113
2828   machine().primary_screen->register_screen_bitmap(m_tree0_bitmap);
2929   machine().primary_screen->register_screen_bitmap(m_tree1_bitmap);
3030
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));
3232   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(30), 30);
3333
3434   save_pointer(NAME(m_memory_devices), 4 * 0x800);
r18112r18113
644644                 written back to RAM
645645*/
646646
647static TIMER_CALLBACK( changela_scanline_callback )
647TIMER_CALLBACK_MEMBER(changela_state::changela_scanline_callback)
648648{
649   changela_state *state = machine.driver_data<changela_state>();
650649   int sy = param;
651650   int sx;
652651
653652   /* clear the current scanline first */
654653   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);
659658
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);
664663
665664   /* Collision Detection */
666665   for (sx = 1; sx < 256; sx++)
667666   {
668667      int riv_col, prev_col;
669668
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))
673672         riv_col = 1;
674673      else
675674         riv_col = 0;
676675
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))
680679         prev_col = 1;
681680      else
682681         prev_col = 0;
683682
684      if (state->m_obj0_bitmap.pix16(sy, sx) == 0x14) /* Car Outline Color */
683      if (m_obj0_bitmap.pix16(sy, sx) == 0x14) /* Car Outline Color */
685684      {
686685         /* 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;
689688
690689         /* 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;
693692
694693         /* Hit Right Bank */
695694         if (riv_col == 0 && prev_col == 1)
696            state->m_right_bank_col = 1;
695            m_right_bank_col = 1;
697696
698697         /* Hit Left Bank */
699698         if (riv_col == 1 && prev_col == 0)
700            state->m_left_bank_col = 1;
699            m_left_bank_col = 1;
701700
702701         /* Boat Hit Shore */
703702         if (riv_col == 1)
704            state->m_boat_shore_col = 1;
703            m_boat_shore_col = 1;
705704      }
706705   }
707   if (!state->m_tree_collision_reset)
706   if (!m_tree_collision_reset)
708707   {
709      state->m_tree0_col = 0;
710      state->m_tree1_col = 0;
708      m_tree0_col = 0;
709      m_tree1_col = 0;
711710   }
712   if (!state->m_collision_reset)
711   if (!m_collision_reset)
713712   {
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;
717716   }
718717
719718   sy++;
720719   if (sy > 256) sy = 30;
721   state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(sy), sy);
720   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(sy), sy);
722721}
723722
724723UINT32 changela_state::screen_update_changela(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
trunk/src/mame/video/triplhnt.c
r18112r18113
2424}
2525
2626
27static TIMER_CALLBACK( triplhnt_hit_callback )
27TIMER_CALLBACK_MEMBER(triplhnt_state::triplhnt_hit_callback)
2828{
29   triplhnt_set_collision(machine, param);
29   triplhnt_set_collision(machine(), param);
3030}
3131
3232
r18112r18113
9999   }
100100
101101   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);
103103}
104104
105105
trunk/src/mame/video/lockon.c
r18112r18113
6262#endif
6363}
6464
65static TIMER_CALLBACK( cursor_callback )
65TIMER_CALLBACK_MEMBER(lockon_state::cursor_callback)
6666{
67   lockon_state *state = machine.driver_data<lockon_state>();
6867
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);
7170
72   state->m_cursor_timer->adjust(machine.primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
71   m_cursor_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
7372}
7473
7574/*************************************
r18112r18113
281280   m_ground_ctrl = data & 0xff;
282281}
283282
284static TIMER_CALLBACK( bufend_callback )
283TIMER_CALLBACK_MEMBER(lockon_state::bufend_callback)
285284{
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);
289287}
290288
291289/* Get data for a each 8x8x3 ground tile */
r18112r18113
909907   m_obj_pal_ram = auto_alloc_array(machine(), UINT8, 2048);
910908
911909   /* 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));
913911
914912   /* 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));
916914   m_cursor_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
917915
918916   save_item(NAME(*m_back_buffer));
trunk/src/mame/video/mystston.c
r18112r18113
4545 *
4646 *************************************/
4747
48static TIMER_CALLBACK( interrupt_callback )
48TIMER_CALLBACK_MEMBER(mystston_state::interrupt_callback)
4949{
50   mystston_state *state = machine.driver_data<mystston_state>();
5150   int scanline = param;
5251
53   mystston_on_scanline_interrupt(machine);
52   mystston_on_scanline_interrupt(machine());
5453
5554   scanline = scanline + 16;
5655   if (scanline >= VTOTAL)
5756      scanline = FIRST_INT_VPOS;
5857
5958   /* the vertical synch chain is clocked by H256 -- this is probably not important, but oh well */
60   state->m_interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline - 1, INT_HPOS), scanline);
59   m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(scanline - 1, INT_HPOS), scanline);
6160}
6261
6362
r18112r18113
224223   m_fg_tilemap->set_transparent_pen(0);
225224
226225   /* 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));
228227}
229228
230229
trunk/src/mame/video/midyunit.c
r18112r18113
358358 *
359359 *************************************/
360360
361static TIMER_CALLBACK( dma_callback )
361TIMER_CALLBACK_MEMBER(midyunit_state::dma_callback)
362362{
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);
366365}
367366
368367
r18112r18113
516515   }
517516
518517   /* 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));
520519
521520   g_profiler.stop();
522521}
r18112r18113
529528 *
530529 *************************************/
531530
532static TIMER_CALLBACK( autoerase_line )
531TIMER_CALLBACK_MEMBER(midyunit_state::autoerase_line)
533532{
534   midyunit_state *state = machine.driver_data<midyunit_state>();
535533   int scanline = param;
536534
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));
539537}
540538
541539
r18112r18113
552550      dest[x] = state->m_pen_map[src[coladdr++ & 0x1ff]];
553551
554552   /* handle autoerase on the previous line */
555   autoerase_line(screen.machine(), NULL, params->rowaddr - 1);
553   state->autoerase_line(NULL, params->rowaddr - 1);
556554
557555   /* if this is the last update of the screen, set a timer to clear out the final line */
558556   /* (since we update one behind) */
559557   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);
561559}
trunk/src/mame/video/nbmj9195.c
r18112r18113
200200   state->m_tmpbitmap[vram].pix16(y, x) = color;
201201}
202202
203static TIMER_CALLBACK( blitter_timer_callback )
203TIMER_CALLBACK_MEMBER(nbmj9195_state::blitter_timer_callback)
204204{
205   nbmj9195_state *state = machine.driver_data<nbmj9195_state>();
206   state->m_nb19010_busyflag = 1;
205   m_nb19010_busyflag = 1;
207206}
208207
209208static void nbmj9195_gfxdraw(running_machine &machine, int vram)
r18112r18113
364363   state->m_nb19010_busyflag = 0;
365364
366365   /* 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));
368367}
369368
370369/******************************************************************************
trunk/src/mame/video/dcheese.c
r18112r18113
7171}
7272
7373
74static TIMER_CALLBACK( blitter_scanline_callback )
74TIMER_CALLBACK_MEMBER(dcheese_state::blitter_scanline_callback)
7575{
76   dcheese_signal_irq(machine, 3);
77   update_scanline_irq(machine);
76   dcheese_signal_irq(machine(), 3);
77   update_scanline_irq(machine());
7878}
7979
8080
81static TIMER_CALLBACK( dcheese_signal_irq_callback )
81TIMER_CALLBACK_MEMBER(dcheese_state::dcheese_signal_irq_callback)
8282{
83   dcheese_signal_irq(machine, param);
83   dcheese_signal_irq(machine(), param);
8484}
8585
8686
r18112r18113
9797   m_dstbitmap = auto_bitmap_ind16_alloc(machine(), DSTBITMAP_WIDTH, DSTBITMAP_HEIGHT);
9898
9999   /* 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));
101101
102102   /* register for saving */
103103   save_item(NAME(m_blitter_color));
r18112r18113
149149      memset(&state->m_dstbitmap->pix16(y % DSTBITMAP_HEIGHT), 0, DSTBITMAP_WIDTH * 2);
150150
151151   /* 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);
153153}
154154
155155
r18112r18113
204204   }
205205
206206   /* 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);
208208
209209   /* these extra parameters are written but they are always zero, so I don't know what they do */
210210   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 ||
trunk/src/mame/video/neogeo.c
r18112r18113
223223}
224224
225225
226static TIMER_CALLBACK( auto_animation_timer_callback )
226TIMER_CALLBACK_MEMBER(neogeo_state::auto_animation_timer_callback)
227227{
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)
230229   {
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;
233232   }
234233   else
235      state->m_auto_animation_frame_counter = state->m_auto_animation_frame_counter - 1;
234      m_auto_animation_frame_counter = m_auto_animation_frame_counter - 1;
236235
237   state->m_auto_animation_timer->adjust(machine.primary_screen->time_until_pos(NEOGEO_VSSTART));
236   m_auto_animation_timer->adjust(machine().primary_screen->time_until_pos(NEOGEO_VSSTART));
238237}
239238
240239
241240static void create_auto_animation_timer( running_machine &machine )
242241{
243242   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));
245244}
246245
247246
r18112r18113
640639}
641640
642641
643static TIMER_CALLBACK( sprite_line_timer_callback )
642TIMER_CALLBACK_MEMBER(neogeo_state::sprite_line_timer_callback)
644643{
645   neogeo_state *state = machine.driver_data<neogeo_state>();
646644   int scanline = param;
647645
648646   /* we are at the beginning of a scanline -
649647       we need to draw the previous scanline and parse the sprites on the current one */
650648   if (scanline != 0)
651      machine.primary_screen->update_partial(scanline - 1);
649      machine().primary_screen->update_partial(scanline - 1);
652650
653   parse_sprites(machine, scanline);
651   parse_sprites(machine(), scanline);
654652
655653   /* let's come back at the beginning of the next line */
656654   scanline = (scanline + 1) % NEOGEO_VTOTAL;
657655
658   state->m_sprite_line_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
656   m_sprite_line_timer->adjust(machine().primary_screen->time_until_pos(scanline), scanline);
659657}
660658
661659
662660static void create_sprite_line_timer( running_machine &machine )
663661{
664662   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));
666664}
667665
668666
trunk/src/mame/video/dc.c
r18112r18113
12921292   #endif
12931293}
12941294
1295static TIMER_CALLBACK( transfer_opaque_list_irq )
1295TIMER_CALLBACK_MEMBER(dc_state::transfer_opaque_list_irq)
12961296{
1297   dc_state *state = machine.driver_data<dc_state>();
12981297
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());
13011300}
13021301
1303static TIMER_CALLBACK( transfer_opaque_modifier_volume_list_irq )
1302TIMER_CALLBACK_MEMBER(dc_state::transfer_opaque_modifier_volume_list_irq)
13041303{
1305   dc_state *state = machine.driver_data<dc_state>();
13061304
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());
13091307}
13101308
1311static TIMER_CALLBACK( transfer_translucent_list_irq )
1309TIMER_CALLBACK_MEMBER(dc_state::transfer_translucent_list_irq)
13121310{
1313   dc_state *state = machine.driver_data<dc_state>();
13141311
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());
13171314}
13181315
1319static TIMER_CALLBACK( transfer_translucent_modifier_volume_list_irq )
1316TIMER_CALLBACK_MEMBER(dc_state::transfer_translucent_modifier_volume_list_irq)
13201317{
1321   dc_state *state = machine.driver_data<dc_state>();
13221318
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());
13251321}
13261322
1327static TIMER_CALLBACK( transfer_punch_through_list_irq )
1323TIMER_CALLBACK_MEMBER(dc_state::transfer_punch_through_list_irq)
13281324{
1329   dc_state *state = machine.driver_data<dc_state>();
13301325
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());
13331328}
13341329
13351330static void process_ta_fifo(running_machine& machine)
r18112r18113
14201415      /* FIXME: timing of these */
14211416      switch (state_ta.tafifo_listtype)
14221417      {
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;
14281423      }
14291424      state_ta.tafifo_listtype= -1; // no list being received
14301425      state_ta.listtype_used |= (2+8);
r18112r18113
24982493         pvr_parameterconfig[a] = pvr_parameterconfig[a-1];
24992494}
25002495
2501static TIMER_CALLBACK(vbin)
2496TIMER_CALLBACK_MEMBER(dc_state::vbin)
25022497{
2503   dc_state *state = machine.driver_data<dc_state>();
2498   dc_state *state = machine().driver_data<dc_state>();
25042499
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());
25072502
2508   state->vbin_timer->adjust(machine.primary_screen->time_until_pos(spg_vblank_in_irq_line_num));
2503   vbin_timer->adjust(machine().primary_screen->time_until_pos(spg_vblank_in_irq_line_num));
25092504}
25102505
2511static TIMER_CALLBACK(vbout)
2506TIMER_CALLBACK_MEMBER(dc_state::vbout)
25122507{
2513   dc_state *state = machine.driver_data<dc_state>();
2508   dc_state *state = machine().driver_data<dc_state>();
25142509
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());
25172512
2518   state->vbout_timer->adjust(machine.primary_screen->time_until_pos(spg_vblank_out_irq_line_num));
2513   vbout_timer->adjust(machine().primary_screen->time_until_pos(spg_vblank_out_irq_line_num));
25192514}
25202515
2521static TIMER_CALLBACK(hbin)
2516TIMER_CALLBACK_MEMBER(dc_state::hbin)
25222517{
2523   dc_state *state = machine.driver_data<dc_state>();
2518   dc_state *state = machine().driver_data<dc_state>();
25242519
25252520   if(spg_hblank_int_mode & 1)
25262521   {
2527      if(state->scanline == state->next_y)
2522      if(scanline == next_y)
25282523      {
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;
25322527      }
25332528   }
2534   else if((state->scanline == spg_line_comp_val) || (spg_hblank_int_mode & 2))
2529   else if((scanline == spg_line_comp_val) || (spg_hblank_int_mode & 2))
25352530   {
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());
25382533   }
25392534
2540//  printf("hbin on state->scanline %d\n",state->scanline);
2535//  printf("hbin on scanline %d\n",scanline);
25412536
2542   state->scanline++;
2537   scanline++;
25432538
2544   if(state->scanline >= spg_vblank_in_irq_line_num)
2539   if(scanline >= spg_vblank_in_irq_line_num)
25452540   {
2546      state->scanline = 0;
2547      state->next_y = spg_line_comp_val;
2541      scanline = 0;
2542      next_y = spg_line_comp_val;
25482543   }
25492544
2550   state->hbin_timer->adjust(machine.primary_screen->time_until_pos(state->scanline, spg_hblank_in_irq-1));
2545   hbin_timer->adjust(machine().primary_screen->time_until_pos(scanline, spg_hblank_in_irq-1));
25512546}
25522547
25532548
25542549
2555static TIMER_CALLBACK(endofrender_video)
2550TIMER_CALLBACK_MEMBER(dc_state::endofrender_video)
25562551{
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);
25612555}
25622556
2563static TIMER_CALLBACK(endofrender_tsp)
2557TIMER_CALLBACK_MEMBER(dc_state::endofrender_tsp)
25642558{
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());
25682561
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) );
25712564}
25722565
2573static TIMER_CALLBACK(endofrender_isp)
2566TIMER_CALLBACK_MEMBER(dc_state::endofrender_isp)
25742567{
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());
25782570
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) );
25812573}
25822574
25832575
r18112r18113
26132605
26142606   computedilated();
26152607
2616   vbout_timer = machine().scheduler().timer_alloc(FUNC(vbout));
2608   vbout_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dc_state::vbout),this));
26172609   vbout_timer->adjust(machine().primary_screen->time_until_pos(spg_vblank_out_irq_line_num_new));
26182610
2619   vbin_timer = machine().scheduler().timer_alloc(FUNC(vbin));
2611   vbin_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dc_state::vbin),this));
26202612   vbin_timer->adjust(machine().primary_screen->time_until_pos(spg_vblank_in_irq_line_num_new));
26212613
2622   hbin_timer = machine().scheduler().timer_alloc(FUNC(hbin));
2614   hbin_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dc_state::hbin),this));
26232615   hbin_timer->adjust(machine().primary_screen->time_until_pos(0, spg_hblank_in_irq_new-1));
26242616
26252617   scanline = 0;
26262618   next_y = 0;
26272619
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));
26312623
26322624   endofrender_timer_isp->adjust(attotime::never);
26332625   endofrender_timer_tsp->adjust(attotime::never);
trunk/src/mame/video/midtunit.c
r18112r18113
588588 *
589589 *************************************/
590590
591static TIMER_CALLBACK( dma_callback )
591TIMER_CALLBACK_MEMBER(midtunit_state::dma_callback)
592592{
593593   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);
595595}
596596
597597
r18112r18113
791791
792792   /* signal we're done */
793793skipdma:
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));
795795
796796   g_profiler.stop();
797797}
trunk/src/mame/video/niyanpai.c
r18112r18113
171171   state->m_tmpbitmap[vram].pix16(y, x) = color;
172172}
173173
174static TIMER_CALLBACK( blitter_timer_callback )
174TIMER_CALLBACK_MEMBER(niyanpai_state::blitter_timer_callback)
175175{
176   niyanpai_state *state = machine.driver_data<niyanpai_state>();
177   state->m_nb19010_busyflag = 1;
176   m_nb19010_busyflag = 1;
178177}
179178
180179static void niyanpai_gfxdraw(running_machine &machine, int vram)
r18112r18113
330329   }
331330
332331   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));
334333}
335334
336335/******************************************************************************
trunk/src/mame/video/twin16.c
r18112r18113
1515#include "emu.h"
1616#include "includes/twin16.h"
1717
18static TIMER_CALLBACK( twin16_sprite_tick );
1918
2019
20
2121enum
2222{
2323   TWIN16_SCREEN_FLIPY      = 0x01,
r18112r18113
137137   return m_sprite_busy;
138138}
139139
140static TIMER_CALLBACK( twin16_sprite_tick )
140TIMER_CALLBACK_MEMBER(twin16_state::twin16_sprite_tick)
141141{
142   twin16_state *state = machine.driver_data<twin16_state>();
143   state->m_sprite_busy = 0;
142   m_sprite_busy = 0;
144143}
145144
146145static int twin16_set_sprite_timer( running_machine &machine )
r18112r18113
500499
501500   memset(m_sprite_buffer,0xff,0x800*sizeof(UINT16));
502501   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));
504503   m_sprite_timer->adjust(attotime::never);
505504
506505   /* register for savestates */
trunk/src/mame/video/rpunch.c
r18112r18113
5858 *
5959 *************************************/
6060
61static TIMER_CALLBACK( crtc_interrupt_gen )
61TIMER_CALLBACK_MEMBER(rpunch_state::crtc_interrupt_gen)
6262{
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);
6564   if (param != 0)
66      state->m_crtc_timer->adjust(machine.primary_screen->frame_period() / param, 0, machine.primary_screen->frame_period() / param);
65      m_crtc_timer->adjust(machine().primary_screen->frame_period() / param, 0, machine().primary_screen->frame_period() / param);
6766}
6867
6968
r18112r18113
8079      memset(m_bitmapram, 0xff, m_bitmapram.bytes());
8180
8281   /* 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));
8483}
8584
8685
trunk/src/mame/video/tubep.c
r18112r18113
423423}
424424
425425
426static TIMER_CALLBACK( sprite_timer_callback )
426TIMER_CALLBACK_MEMBER(tubep_state::sprite_timer_callback)
427427{
428   machine.device("mcu")->execute().set_input_line(0, ASSERT_LINE);
428   machine().device("mcu")->execute().set_input_line(0, ASSERT_LINE);
429429}
430430
431431
r18112r18113
558558         machine().device("mcu")->execute().set_input_line(0, CLEAR_LINE);
559559
560560         /* 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));
562562
563563         /* 3.clear of /SINT starts sprite drawing circuit */
564564         draw_sprite(machine());
trunk/src/mame/video/exidy.c
r18112r18113
261261
262262***************************************************************************/
263263
264static TIMER_CALLBACK( collision_irq_callback )
264TIMER_CALLBACK_MEMBER(exidy_state::collision_irq_callback)
265265{
266266   /* latch the collision bits */
267   latch_condition(machine, param);
267   latch_condition(machine(), param);
268268
269269   /* 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);
271271}
272272
273273
r18112r18113
334334
335335            /* if we got one, trigger an interrupt */
336336            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);
338338         }
339339
340340         if (state->m_motion_object_2_vid.pix16(sy, sx) != 0xff)
r18112r18113
342342            /* check for background collision (M2CHAR) */
343343            if (state->m_background_bitmap.pix16(org_2_y + sy, org_2_x + sx) != 0)
344344               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);
346346         }
347347      }
348348}
trunk/src/mame/video/hyhoo.c
r18112r18113
5656}
5757
5858
59static TIMER_CALLBACK( blitter_timer_callback )
59TIMER_CALLBACK_MEMBER(hyhoo_state::blitter_timer_callback)
6060{
6161   nb1413m3_busyflag = 1;
6262}
r18112r18113
218218   }
219219
220220   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));
222222}
223223
224224
trunk/src/mame/video/itech32.c
r18112r18113
119119
120120
121121
122static TIMER_CALLBACK( scanline_interrupt );
123122
124123
125124
125
126126/*************************************
127127 *
128128 *  Macros and inlines
r18112r18113
193193   /* reset statics */
194194   memset(m_video, 0, 0x80);
195195
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));
197197   m_enable_latch[0] = 1;
198198   m_enable_latch[1] = (m_planes > 1) ? 1 : 0;
199199}
r18112r18113
437437}
438438
439439
440static TIMER_CALLBACK( scanline_interrupt )
440TIMER_CALLBACK_MEMBER(itech32_state::scanline_interrupt)
441441{
442   itech32_state *state = machine.driver_data<itech32_state>();
443442   /* set timer for next frame */
444   state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(state->VIDEO_INTSCANLINE));
443   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(VIDEO_INTSCANLINE));
445444
446445   /* 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;
449448
450449   /* update the interrupt state */
451   update_interrupts(machine, 0);
450   update_interrupts(machine(), 0);
452451}
453452
454453
trunk/src/mame/video/dday.c
r18112r18113
2323   return ((m_timer_value / 10) << 4) | (m_timer_value % 10);
2424}
2525
26static TIMER_CALLBACK( countdown_timer_callback )
26TIMER_CALLBACK_MEMBER(dday_state::countdown_timer_callback)
2727{
28   dday_state *state = machine.driver_data<dday_state>();
29   state->m_timer_value--;
28   m_timer_value--;
3029
31   if (state->m_timer_value < 0)
32      state->m_timer_value = 99;
30   if (m_timer_value < 0)
31      m_timer_value = 99;
3332}
3433
3534static void start_countdown_timer(running_machine &machine)
r18112r18113
3837
3938   state->m_timer_value = 0;
4039
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));
4241}
4342
4443
trunk/src/mame/video/tx1.c
r18112r18113
3131/*
3232    TODO: Check interrupt timing from CRT config. Probably different between games.
3333*/
34static TIMER_CALLBACK( interrupt_callback )
34TIMER_CALLBACK_MEMBER(tx1_state::interrupt_callback)
3535{
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));
3938}
4039
4140
r18112r18113
11131112   m_rod_bmp = auto_alloc_array(machine(), UINT8, 256 * 3 * 240);
11141113
11151114   /* 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));
11171116
11181117   /* /CUDISP CRTC interrupt */
11191118   m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
r18112r18113
30013000   m_rod_bmp = auto_alloc_array(machine(), UINT8, 3 * 256 * 240);
30023001
30033002   /* 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));
30053004
30063005   /* /CUDISP CRTC interrupt */
30073006   m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
r18112r18113
30153014   m_rod_bmp = auto_alloc_array(machine(), UINT8, 256 * 240);
30163015
30173016   /* 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));
30193018
30203019   /* /CUDISP CRTC interrupt */
30213020   m_interrupt_timer->adjust(machine().primary_screen->time_until_pos(CURSOR_YPOS, CURSOR_XPOS));
trunk/src/mame/video/segag80r.c
r18112r18113
1919 *
2020 *************************************/
2121
22static TIMER_CALLBACK( vblank_latch_clear )
22TIMER_CALLBACK_MEMBER(segag80r_state::vblank_latch_clear)
2323{
24   segag80r_state *state = machine.driver_data<segag80r_state>();
25   state->m_vblank_latch = 0;
24   m_vblank_latch = 0;
2625}
2726
2827
r18112r18113
3231   /* set a timer to mimic the 555 timer that drives the EDGINT signal */
3332   /* the 555 is run in monostable mode with R=56000 and C=1000pF */
3433   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));
3635
3736   /* latch the current flip state at the same time */
3837   state->m_video_flip = state->m_video_control & 1;
trunk/src/mame/video/gameplan.c
r18112r18113
138138}
139139
140140
141static TIMER_CALLBACK( clear_screen_done_callback )
141TIMER_CALLBACK_MEMBER(gameplan_state::clear_screen_done_callback)
142142{
143   gameplan_state *state = machine.driver_data<gameplan_state>();
144143
145144   /* indicate that the we are done clearing the screen */
146   state->m_via_0->write_ca1(0);
145   m_via_0->write_ca1(0);
147146}
148147
149148
r18112r18113
201200         /* set a timer for an arbitrarily short period.
202201               The real time it takes to clear to screen is not
203202               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));
205204
206205         break;
207206      }
r18112r18113
209208}
210209
211210
212static TIMER_CALLBACK( via_irq_delayed )
211TIMER_CALLBACK_MEMBER(gameplan_state::via_irq_delayed)
213212{
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);
216214}
217215
218216
219217static void via_irq(device_t *device, int state)
220218{
219   gameplan_state *driver_state = device->machine().driver_data<gameplan_state>();
221220   /* Kaos sits in a tight loop polling the VIA irq flags register, but that register is
222221       cleared by the irq handler. Therefore, I wait a bit before triggering the irq to
223222       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);
225224}
226225
227226
r18112r18113
262261};
263262
264263
265static TIMER_CALLBACK( via_0_ca1_timer_callback )
264TIMER_CALLBACK_MEMBER(gameplan_state::via_0_ca1_timer_callback)
266265{
267   gameplan_state *state = machine.driver_data<gameplan_state>();
268266
269267   /* !VBLANK is connected to CA1 */
270   state->m_via_0->write_ca1(param);
268   m_via_0->write_ca1(param);
271269
272270   if (param)
273      state->m_via_0_ca1_timer->adjust(machine.primary_screen->time_until_pos(VBSTART));
271      m_via_0_ca1_timer->adjust(machine().primary_screen->time_until_pos(VBSTART));
274272   else
275      state->m_via_0_ca1_timer->adjust(machine.primary_screen->time_until_pos(VBEND), 1);
273      m_via_0_ca1_timer->adjust(machine().primary_screen->time_until_pos(VBEND), 1);
276274}
277275
278276
r18112r18113
288286   m_videoram_size = (HBSTART - HBEND) * (VBSTART - VBEND);
289287   m_videoram = auto_alloc_array(machine(), UINT8, m_videoram_size);
290288
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));
292290
293291   /* register for save states */
294292   save_pointer(NAME(m_videoram), m_videoram_size);
trunk/src/mame/video/lethalj.c
r18112r18113
9393 *
9494 *************************************/
9595
96static TIMER_CALLBACK( gen_ext1_int )
96TIMER_CALLBACK_MEMBER(lethalj_state::gen_ext1_int)
9797{
98   machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
98   machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
9999}
100100
101101
r18112r18113
152152      else
153153         do_blit();
154154
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));
156156   }
157157
158158   /* clear the IRQ on offset 0 */
trunk/src/mame/video/starfire.c
r18112r18113
77#include "emu.h"
88#include "includes/starfire.h"
99
10static TIMER_CALLBACK( starfire_scanline_callback );
1110
11
1212/*************************************
1313 *
1414 *  Initialize the video system
r18112r18113
1919{
2020
2121   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));
2323   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(STARFIRE_VBEND), STARFIRE_VBEND);
2424
2525    /* register for state saving */
r18112r18113
229229   }
230230}
231231
232static TIMER_CALLBACK( starfire_scanline_callback )
232TIMER_CALLBACK_MEMBER(starfire_state::starfire_scanline_callback)
233233{
234    starfire_state *state = machine.driver_data<starfire_state>();
235234    pen_t pens[STARFIRE_NUM_PENS];
236235   int y = param;
237236
238   get_pens(machine, pens);
237   get_pens(machine(), pens);
239238
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];
242241
243242   for (int x = 0; x < 256; x += 8)
244243   {
245244      int data = pix[0];
246245      int color = col[0];
247246
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)];
256255
257256      pix += 256;
258257      col += 256;
r18112r18113
260259
261260   y++;
262261   if (y >= STARFIRE_VBSTART) y = STARFIRE_VBEND;
263   state->m_scanline_timer->adjust(machine.primary_screen->time_until_pos(y), y);
262   m_scanline_timer->adjust(machine().primary_screen->time_until_pos(y), y);
264263}
265264
266265UINT32 starfire_state::screen_update_starfire(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
trunk/src/mame/video/galaxold.c
r18112r18113
3232
3333static void drivfrcg_modify_color(UINT8 *color);
3434
35static TIMER_CALLBACK( stars_blink_callback );
36static TIMER_CALLBACK( stars_scroll_callback );
3735
36
37
3838       void galaxold_init_stars(running_machine &machine, int colors_offset);
3939static void     noop_draw_stars(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect);
4040       void galaxold_draw_stars(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect);
r18112r18113
13671367
13681368   state->m_stars_on = 0;
13691369   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));
13721372   state->m_timer_adjusted = 0;
13731373   state->m_stars_colors_start = colors_offset;
13741374
r18112r18113
16041604   }
16051605}
16061606
1607static TIMER_CALLBACK( stars_blink_callback )
1607TIMER_CALLBACK_MEMBER(galaxold_state::stars_blink_callback)
16081608{
1609   galaxold_state *state = machine.driver_data<galaxold_state>();
1610   state->m_stars_blink_state++;
1609   m_stars_blink_state++;
16111610}
16121611
16131612static void start_stars_blink_timer(running_machine &machine, double ra, double rb, double c)
r18112r18113
16211620}
16221621
16231622
1624static TIMER_CALLBACK( stars_scroll_callback )
1623TIMER_CALLBACK_MEMBER(galaxold_state::stars_scroll_callback)
16251624{
1626   galaxold_state *state = machine.driver_data<galaxold_state>();
1627   if (state->m_stars_on)
1625   if (m_stars_on)
16281626   {
1629      state->m_stars_scrollpos++;
1627      m_stars_scrollpos++;
16301628   }
16311629}
16321630
trunk/src/mame/video/midvunit.c
r18112r18113
3434 *
3535 *************************************/
3636
37static TIMER_CALLBACK( scanline_timer_cb )
37TIMER_CALLBACK_MEMBER(midvunit_state::scanline_timer_cb)
3838{
39   midvunit_state *state = machine.driver_data<midvunit_state>();
4039   int scanline = param;
4140
4241   if (scanline != -1)
4342   {
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);
4746   }
4847   else
49      machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
48      machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
5049}
5150
5251
5352void midvunit_state::video_start()
5453{
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));
5655
5756   m_poly = auto_alloc(machine(), midvunit_renderer(*this));
5857
trunk/src/emu/cpu/psx/sio.h
r18112r18113
8282private:
8383   void sio_interrupt( int n_port );
8484   void sio_timer_adjust( int n_port );
85   void sio_clock(void *ptr, int param);
85   TIMER_CALLBACK_MEMBER(sio_clock);
8686
8787   psx_sio port[2];
8888};
trunk/src/emu/cpu/psx/dma.c
r18112r18113
190190   dma_stop_timer( index );
191191}
192192
193void psxdma_device::dma_finished_callback(void *ptr, int param)
193TIMER_CALLBACK_MEMBER(psxdma_device::dma_finished_callback)
194194{
195195   dma_finished(param);
196196}
trunk/src/emu/cpu/psx/dma.h
r18112r18113
5151   void dma_timer_adjust( int n_channel );
5252   void dma_interrupt_update();
5353   void dma_finished( int n_channel );
54   void dma_finished_callback(void *ptr, int param);
54   TIMER_CALLBACK_MEMBER(dma_finished_callback);
5555   void write( offs_t offset, UINT32 data, UINT32 mem_mask );
5656   UINT32 read( offs_t offset, UINT32 mem_mask );
5757
trunk/src/emu/cpu/psx/rcnt.c
r18112r18113
213213   }
214214}
215215
216void psxrcnt_device::root_finished( void *ptr, int param )
216TIMER_CALLBACK_MEMBER(psxrcnt_device::root_finished)
217217{
218218   int n_counter = param;
219219   psx_root *root = &root_counter[ n_counter ];
trunk/src/emu/cpu/psx/rcnt.h
r18112r18113
5353   UINT16 root_current( int n_counter );
5454   int root_target( int n_counter );
5555   void root_timer_adjust( int n_counter );
56   void root_finished( void *ptr, int param );
56   TIMER_CALLBACK_MEMBER(root_finished);
5757};
5858
5959#endif
trunk/src/emu/cpu/psx/sio.c
r18112r18113
157157   sio->timer->adjust( n_time, n_port);
158158}
159159
160void psxsio_device::sio_clock(void *ptr, int param)
160TIMER_CALLBACK_MEMBER(psxsio_device::sio_clock)
161161{
162162   int n_port = param;
163163   psx_sio *sio = &port[ n_port ];
trunk/src/emu/schedule.h
r18112r18113
6363#define PERIOD_OF_555_ASTABLE(r1,r2,c)      attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c))
6464
6565#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)
6667
67
68
6968//**************************************************************************
7069//  TYPE DEFINITIONS
7170//**************************************************************************

Previous 199869 Revisions Next


© 1997-2024 The MAME Team