Previous 199869 Revisions Next

r22833 Wednesday 15th May, 2013 at 18:07:06 UTC by Andrew Gardner
More MAME drivers lose their anonymous timers. (nw)
[src/mame/drivers]artmagic.c asterix.c astinvad.c capbowl.c cball.c destroyr.c esh.c fgoal.c firetrk.c flyball.c galastrm.c gpworld.c gticlub.c gunbustr.c mappy.c megatech.c mlanding.c rabbit.c taito_f2.c thayers.c thunderx.c toaplan2.c toypop.c
[src/mame/includes]artmagic.h asterix.h capbowl.h fgoal.h firetrk.h galastrm.h gunbustr.h mappy.h megadriv.h taito_f2.h thunderx.h toaplan2.h toypop.h

trunk/src/mame/drivers/mappy.c
r22832r22833
747747
748748/* different games need different interrupt generators & timers because they use different Namco I/O devices */
749749
750void mappy_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
751{
752   switch (id)
753   {
754   case TIMER_SUPERPAC_IO_RUN:
755      superpac_io_run(ptr, param);
756      break;
757   case TIMER_PACNPAL_IO_RUN:
758      pacnpal_io_run(ptr, param);
759      break;
760   case TIMER_PHOZON_IO_RUN:
761      phozon_io_run(ptr, param);
762      break;
763   case TIMER_MAPPY_IO_RUN:
764      mappy_io_run(ptr, param);
765      break;
766   default:
767      assert_always(FALSE, "Unknown id in mappy_state::device_timer");
768   }
769}
770
750771TIMER_CALLBACK_MEMBER(mappy_state::superpac_io_run)
751772{
752773   device_t *io56xx_1 = machine().device("namcoio_1");
r22832r22833
772793      m_maincpu->set_input_line(0, ASSERT_LINE);
773794
774795   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), timer_expired_delegate(FUNC(mappy_state::superpac_io_run),this));
796      timer_set(attotime::from_usec(50), TIMER_SUPERPAC_IO_RUN);
776797
777798   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), timer_expired_delegate(FUNC(mappy_state::superpac_io_run),this), 1);
799      timer_set(attotime::from_usec(50), TIMER_SUPERPAC_IO_RUN, 1);
779800}
780801
781802TIMER_CALLBACK_MEMBER(mappy_state::pacnpal_io_run)
r22832r22833
803824      m_maincpu->set_input_line(0, ASSERT_LINE);
804825
805826   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), timer_expired_delegate(FUNC(mappy_state::pacnpal_io_run),this));
827      timer_set(attotime::from_usec(50), TIMER_PACNPAL_IO_RUN);
807828
808829   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), timer_expired_delegate(FUNC(mappy_state::pacnpal_io_run),this), 1);
830      timer_set(attotime::from_usec(50), TIMER_PACNPAL_IO_RUN, 1);
810831}
811832
812833TIMER_CALLBACK_MEMBER(mappy_state::phozon_io_run)
r22832r22833
834855      m_maincpu->set_input_line(0, ASSERT_LINE);
835856
836857   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), timer_expired_delegate(FUNC(mappy_state::phozon_io_run),this));
858      timer_set(attotime::from_usec(50), TIMER_PHOZON_IO_RUN);
838859
839860   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), timer_expired_delegate(FUNC(mappy_state::phozon_io_run),this), 1);
861      timer_set(attotime::from_usec(50), TIMER_PHOZON_IO_RUN, 1);
841862}
842863
843864TIMER_CALLBACK_MEMBER(mappy_state::mappy_io_run)
r22832r22833
865886      m_maincpu->set_input_line(0, ASSERT_LINE);
866887
867888   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), timer_expired_delegate(FUNC(mappy_state::mappy_io_run),this));
889      timer_set(attotime::from_usec(50), TIMER_MAPPY_IO_RUN);
869890
870891   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), timer_expired_delegate(FUNC(mappy_state::mappy_io_run),this), 1);
892      timer_set(attotime::from_usec(50), TIMER_MAPPY_IO_RUN, 1);
872893}
873894
874895INTERRUPT_GEN_MEMBER(mappy_state::sub_vblank_irq)
trunk/src/mame/drivers/esh.c
r22832r22833
3131class esh_state : public driver_device
3232{
3333public:
34   enum
35   {
36      TIMER_IRQ_STOP
37   };
38
3439   esh_state(const machine_config &mconfig, device_type type, const char *tag)
3540      : driver_device(mconfig, type, tag),
3641         m_laserdisc(*this, "laserdisc") ,
r22832r22833
5257   virtual void palette_init();
5358   UINT32 screen_update_esh(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
5459   INTERRUPT_GEN_MEMBER(vblank_callback_esh);
55   TIMER_CALLBACK_MEMBER(irq_stop);
5660   required_device<cpu_device> m_maincpu;
61
62protected:
63   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5764};
5865
5966
r22832r22833
282289   GFXDECODE_ENTRY("gfx1", 0, esh_gfx_layout, 0x0, 0x20)
283290GFXDECODE_END
284291
285TIMER_CALLBACK_MEMBER(esh_state::irq_stop)
292void esh_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
286293{
287   m_maincpu->set_input_line(0, CLEAR_LINE);
294   switch (id)
295   {
296   case TIMER_IRQ_STOP:
297      m_maincpu->set_input_line(0, CLEAR_LINE);
298      break;
299   default:
300      assert_always(FALSE, "Unknown id in esh_state::device_timer");
301   }
288302}
289303
290304INTERRUPT_GEN_MEMBER(esh_state::vblank_callback_esh)
291305{
292306   // IRQ
293307   device.execute().set_input_line(0, ASSERT_LINE);
294   machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(esh_state::irq_stop),this));
308   timer_set(attotime::from_usec(50), TIMER_IRQ_STOP);
295309}
296310
297311void esh_state::machine_start()
trunk/src/mame/drivers/asterix.c
r22832r22833
6666   return m_k053260->k053260_r(space, 2 + offset);
6767}
6868
69TIMER_CALLBACK_MEMBER(asterix_state::nmi_callback)
69void asterix_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
7070{
71   m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
71   switch (id)
72   {
73   case TIMER_NMI:
74      m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
75      break;
76   default:
77      assert_always(FALSE, "Unknown id in asterix_state::device_timer");
78   }
7279}
7380
7481WRITE8_MEMBER(asterix_state::sound_arm_nmi_w)
7582{
7683   m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
77   machine().scheduler().timer_set(attotime::from_usec(5), timer_expired_delegate(FUNC(asterix_state::nmi_callback),this));
84   timer_set(attotime::from_usec(5), TIMER_NMI);
7885}
7986
8087WRITE16_MEMBER(asterix_state::sound_irq_w)
trunk/src/mame/drivers/toaplan2.c
r22832r22833
473473  Toaplan games
474474***************************************************************************/
475475
476
477TIMER_CALLBACK_MEMBER(toaplan2_state::toaplan2_raise_irq)
476void toaplan2_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
478477{
479   m_maincpu->set_input_line(param, HOLD_LINE);
478   switch (id)
479   {
480   case TIMER_RAISE_IRQ:
481      m_maincpu->set_input_line(param, HOLD_LINE);
482      break;
483   default:
484      assert_always(FALSE, "Unknown id in toaplan2_state::device_timer");
485   }
480486}
481487
482488void toaplan2_state::toaplan2_vblank_irq(int irq_line)
483489{
484490   // the IRQ appears to fire at line 0xe6
485   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0xe6), timer_expired_delegate(FUNC(toaplan2_state::toaplan2_raise_irq),this), irq_line);
491   timer_set(machine().primary_screen->time_until_pos(0xe6), TIMER_RAISE_IRQ, irq_line);
486492}
487493
488494INTERRUPT_GEN_MEMBER(toaplan2_state::toaplan2_vblank_irq1){ toaplan2_vblank_irq(1); }
trunk/src/mame/drivers/cball.c
r22832r22833
1111class cball_state : public driver_device
1212{
1313public:
14   enum
15   {
16      TIMER_INTERRUPT
17   };
18
1419   cball_state(const machine_config &mconfig, device_type type, const char *tag)
1520      : driver_device(mconfig, type, tag),
1621      m_video_ram(*this, "video_ram"),
r22832r22833
3540   virtual void palette_init();
3641   UINT32 screen_update_cball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3742   TIMER_CALLBACK_MEMBER(interrupt_callback);
43
44protected:
45   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
3846};
3947
4048
r22832r22833
7583}
7684
7785
86void cball_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
87{
88   switch (id)
89   {
90   case TIMER_INTERRUPT:
91      interrupt_callback(ptr, param);
92      break;
93   default:
94      assert_always(FALSE, "Unknown id in cball_state::device_timer");
95   }
96}
97
98
7899TIMER_CALLBACK_MEMBER(cball_state::interrupt_callback)
79100{
80101   int scanline = param;
r22832r22833
86107   if (scanline >= 262)
87108      scanline = 16;
88109
89   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(cball_state::interrupt_callback),this), scanline);
110   timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_INTERRUPT, scanline);
90111}
91112
92113
r22832r22833
96117
97118void cball_state::machine_reset()
98119{
99   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(16), timer_expired_delegate(FUNC(cball_state::interrupt_callback),this), 16);
120   timer_set(machine().primary_screen->time_until_pos(16), TIMER_INTERRUPT, 16);
100121}
101122
102123
trunk/src/mame/drivers/fgoal.c
r22832r22833
6969}
7070
7171
72void fgoal_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
73{
74   switch (id)
75   {
76   case TIMER_INTERRUPT:
77      interrupt_callback(ptr, param);
78      break;
79   default:
80      assert_always(FALSE, "Unknown id in fgoal_state::device_timer");
81   }
82}
83
84
7285TIMER_CALLBACK_MEMBER(fgoal_state::interrupt_callback)
7386{
7487   int scanline;
r22832r22833
8699   if (scanline > 256)
87100      scanline = 0;
88101
89   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(fgoal_state::interrupt_callback),this));
102   timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_INTERRUPT);
90103}
91104
92105
r22832r22833
339352
340353void fgoal_state::machine_reset()
341354{
342   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(fgoal_state::interrupt_callback),this));
355   timer_set(machine().primary_screen->time_until_pos(0), TIMER_INTERRUPT);
343356
344357   m_xpos = 0;
345358   m_ypos = 0;
trunk/src/mame/drivers/megatech.c
r22832r22833
213213}
214214
215215
216void mtech_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
217{
218   switch (id)
219   {
220   case TIMER_Z80_RUN_STATE:
221      megatech_z80_run_state(ptr, param);
222      break;
223   case TIMER_Z80_STOP_STATE:
224      megatech_z80_stop_state(ptr, param);
225      break;
226   default:
227      assert_always(FALSE, "Unknown id in mtech_state::device_timer");
228   }
229}
216230
231
217232TIMER_CALLBACK_MEMBER(mtech_state::megatech_z80_run_state )
218233{
219234   char tempname[20];
r22832r22833
266281   if (game_region)
267282   {
268283      {
269         machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(mtech_state::megatech_z80_run_state),this), param);
284         timer_set(attotime::zero, TIMER_Z80_RUN_STATE, param);
270285      }
271286   }
272287   else
r22832r22833
281296
282297void mtech_state::megatech_select_game(int gameno)
283298{
284   machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(mtech_state::megatech_z80_stop_state),this), gameno);
299   timer_set(attotime::zero, TIMER_Z80_STOP_STATE, gameno);
285300}
286301
287302WRITE8_MEMBER(mtech_state::megatech_cart_select_w )
trunk/src/mame/drivers/gticlub.c
r22832r22833
238238class gticlub_state : public driver_device
239239{
240240public:
241   enum
242   {
243      TIMER_IRQ_OFF
244   };
245
241246   gticlub_state(const machine_config &mconfig, device_type type, const char *tag)
242247      : driver_device(mconfig, type, tag),
243248      m_work_ram(*this, "work_ram"),
r22832r22833
273278   DECLARE_MACHINE_RESET(gticlub);
274279   DECLARE_MACHINE_RESET(hangplt);
275280   INTERRUPT_GEN_MEMBER(gticlub_vblank);
276   TIMER_CALLBACK_MEMBER(irq_off);
277281   required_device<cpu_device> m_maincpu;
278282   required_device<cpu_device> m_audiocpu;
279283   required_device<cpu_device> m_dsp;
280284   optional_device<cpu_device> m_dsp2;
281285   required_device<eeprom_device> m_eeprom;
286
287protected:
288   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
282289};
283290
284291
r22832r22833
718725};
719726
720727
721TIMER_CALLBACK_MEMBER(gticlub_state::irq_off)
728void gticlub_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
722729{
723   m_audiocpu->set_input_line(param, CLEAR_LINE);
730   switch (id)
731   {
732   case TIMER_IRQ_OFF:
733      m_audiocpu->set_input_line(param, CLEAR_LINE);
734      break;
735   default:
736      assert_always(FALSE, "Unknown id in gticlub_state::device_timer");
737   }
724738}
725739
726740static void sound_irq_callback( running_machine &machine, int irq )
r22832r22833
729743   int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2;
730744
731745   state->m_audiocpu->set_input_line(line, ASSERT_LINE);
732   machine.scheduler().timer_set(attotime::from_usec(5), timer_expired_delegate(FUNC(gticlub_state::irq_off),state), line);
746   state->timer_set(attotime::from_usec(5), gticlub_state::TIMER_IRQ_OFF, line);
733747}
734748
735749static const k056800_interface gticlub_k056800_interface =
trunk/src/mame/drivers/thunderx.c
r22832r22833
3131      device.execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
3232}
3333
34TIMER_CALLBACK_MEMBER(thunderx_state::thunderx_firq_callback)
34void thunderx_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
3535{
36   m_maincpu->set_input_line(KONAMI_FIRQ_LINE, HOLD_LINE);
36   switch (id)
37   {
38   case TIMER_THUNDERX_FIRQ:
39      m_maincpu->set_input_line(KONAMI_FIRQ_LINE, HOLD_LINE);
40      break;
41   default:
42      assert_always(FALSE, "Unknown id in thunderx_state::device_timer");
43   }
3744}
3845
3946READ8_MEMBER(thunderx_state::scontra_bankedram_r)
r22832r22833
301308      calculate_collisions();
302309
303310      /* 100 cycle delay is arbitrary */
304      machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(100), timer_expired_delegate(FUNC(thunderx_state::thunderx_firq_callback),this));
311      timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(100), TIMER_THUNDERX_FIRQ);
305312   }
306313
307314   m_1f98_data = data;
trunk/src/mame/drivers/astinvad.c
r22832r22833
4444class astinvad_state : public driver_device
4545{
4646public:
47   enum
48   {
49      TIMER_INT_OFF,
50      TIMER_INT_GEN
51   };
52
4753   astinvad_state(const machine_config &mconfig, device_type type, const char *tag)
4854      : driver_device(mconfig, type, tag),
4955      m_maincpu(*this, "maincpu"),
r22832r22833
8793   TIMER_CALLBACK_MEMBER(kamikaze_int_off);
8894   TIMER_CALLBACK_MEMBER(kamizake_int_gen);
8995   void plot_byte( bitmap_rgb32 &bitmap, UINT8 y, UINT8 x, UINT8 data, UINT8 color );
96
97protected:
98   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
9099};
91100
92101
r22832r22833
231240 *
232241 *************************************/
233242
243void astinvad_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
244{
245   switch (id)
246   {
247   case TIMER_INT_OFF:
248      kamikaze_int_off(ptr, param);
249      break;
250   case TIMER_INT_GEN:
251      kamizake_int_gen(ptr, param);
252      break;
253   default:
254      assert_always(FALSE, "Unknown id in astinvad_state::device_timer");
255   }
256}
257
258
234259TIMER_CALLBACK_MEMBER(astinvad_state::kamikaze_int_off)
235260{
236261   m_maincpu->set_input_line(0, CLEAR_LINE);
r22832r22833
245270   m_int_timer->adjust(machine().primary_screen->time_until_pos(param), param);
246271
247272   /* an RC circuit turns the interrupt off after a short amount of time */
248   machine().scheduler().timer_set(attotime::from_double(300 * 0.1e-6), timer_expired_delegate(FUNC(astinvad_state::kamikaze_int_off),this));
273   timer_set(attotime::from_double(300 * 0.1e-6), TIMER_INT_OFF);
249274}
250275
251276
252277MACHINE_START_MEMBER(astinvad_state,kamikaze)
253278{
254   m_int_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(astinvad_state::kamizake_int_gen),this));
279   m_int_timer = timer_alloc(TIMER_INT_GEN);
255280   m_int_timer->adjust(machine().primary_screen->time_until_pos(128), 128);
256281
257282   save_item(NAME(m_screen_flip));
trunk/src/mame/drivers/taito_f2.c
r22832r22833
572572
573573******************************************************************/
574574
575TIMER_CALLBACK_MEMBER(taitof2_state::taitof2_interrupt6)
575void taitof2_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
576576{
577   m_maincpu->set_input_line(6, HOLD_LINE);
577   switch (id)
578   {
579   case TIMER_TAITOF2_INTERRUPT6:
580      m_maincpu->set_input_line(6, HOLD_LINE);
581      break;
582   default:
583      assert_always(FALSE, "Unknown id in taitof2_state::device_timer");
584   }
578585}
579586
580587INTERRUPT_GEN_MEMBER(taitof2_state::taitof2_interrupt)
581588{
582   machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(500), timer_expired_delegate(FUNC(taitof2_state::taitof2_interrupt6),this));
589   timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(500), TIMER_TAITOF2_INTERRUPT6);
583590   device.execute().set_input_line(5, HOLD_LINE);
584591}
585592
trunk/src/mame/drivers/destroyr.c
r22832r22833
1818class destroyr_state : public driver_device
1919{
2020public:
21   enum
22   {
23      TIMER_DESTROYR_DIAL,
24      TIMER_DESTROYR_FRAME
25   };
26
2127   destroyr_state(const machine_config &mconfig, device_type type, const char *tag)
2228      : driver_device(mconfig, type, tag),
2329      m_alpha_num_ram(*this, "alpha_nuram"),
r22832r22833
5561   UINT32 screen_update_destroyr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5662   TIMER_CALLBACK_MEMBER(destroyr_dial_callback);
5763   TIMER_CALLBACK_MEMBER(destroyr_frame_callback);
64
65protected:
66   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5867};
5968
6069
r22832r22833
124133   return 0;
125134}
126135
136
137void destroyr_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
138{
139   switch (id)
140   {
141   case TIMER_DESTROYR_DIAL:
142      destroyr_dial_callback(ptr, param);
143      break;
144   case TIMER_DESTROYR_FRAME:
145      destroyr_frame_callback(ptr, param);
146      break;
147   default:
148      assert_always(FALSE, "Unknown id in destroyr_state::device_timer");
149   }
150}
151
152
127153TIMER_CALLBACK_MEMBER(destroyr_state::destroyr_dial_callback)
128154{
129155   int dial = param;
r22832r22833
150176   m_potsense[1] = 0;
151177
152178   /* PCB supports two dials, but cab has only got one */
153   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(ioport("PADDLE")->read()), timer_expired_delegate(FUNC(destroyr_state::destroyr_dial_callback),this));
154   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(destroyr_state::destroyr_frame_callback),this));
179   timer_set(machine().primary_screen->time_until_pos(ioport("PADDLE")->read()), TIMER_DESTROYR_DIAL);
180   timer_set(machine().primary_screen->time_until_pos(0), TIMER_DESTROYR_FRAME);
155181}
156182
157183
158184void destroyr_state::machine_reset()
159185{
160   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(destroyr_state::destroyr_frame_callback),this));
186   timer_set(machine().primary_screen->time_until_pos(0), TIMER_DESTROYR_FRAME);
161187
162188   m_cursor = 0;
163189   m_wavemod = 0;
trunk/src/mame/drivers/flyball.c
r22832r22833
2121class flyball_state : public driver_device
2222{
2323public:
24   enum
25   {
26      TIMER_FLYBALL_JOYSTICK,
27      TIMER_FLYBALL_QUARTER
28   };
29
2430   flyball_state(const machine_config &mconfig, device_type type, const char *tag)
2531      : driver_device(mconfig, type, tag),
2632      m_playfield_ram(*this, "playfield_ram"),
r22832r22833
6470   UINT32 screen_update_flyball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6571   TIMER_CALLBACK_MEMBER(flyball_joystick_callback);
6672   TIMER_CALLBACK_MEMBER(flyball_quarter_callback);
73
74protected:
75   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
6776};
6877
6978
r22832r22833
132141}
133142
134143
144void flyball_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
145{
146   switch (id)
147   {
148   case TIMER_FLYBALL_JOYSTICK:
149      flyball_joystick_callback(ptr, param);
150      break;
151   case TIMER_FLYBALL_QUARTER:
152      flyball_quarter_callback(ptr, param);
153      break;
154   default:
155      assert_always(FALSE, "Unknown id in flyball_state::device_timer");
156   }
157}
158
159
135160TIMER_CALLBACK_MEMBER(flyball_state::flyball_joystick_callback)
136161{
137162   int potsense = param;
r22832r22833
157182
158183   for (i = 0; i < 64; i++)
159184      if (potsense[i] != 0)
160         machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline + i), timer_expired_delegate(FUNC(flyball_state::flyball_joystick_callback),this), potsense[i]);
185         timer_set(machine().primary_screen->time_until_pos(scanline + i), TIMER_FLYBALL_JOYSTICK, potsense[i]);
161186
162187   scanline += 0x40;
163188   scanline &= 0xff;
164189
165   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(flyball_state::flyball_quarter_callback),this), scanline);
190   timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_FLYBALL_QUARTER, scanline);
166191
167192   m_potsense = 0;
168193   m_potmask = 0;
r22832r22833
396421
397422   m_maincpu->reset();
398423
399   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(flyball_state::flyball_quarter_callback),this));
424   timer_set(machine().primary_screen->time_until_pos(0), TIMER_FLYBALL_QUARTER);
400425
401426   m_pitcher_vert = 0;
402427   m_pitcher_horz = 0;
trunk/src/mame/drivers/rabbit.c
r22832r22833
8989class rabbit_state : public driver_device
9090{
9191public:
92   enum
93   {
94      TIMER_BLIT_DONE
95   };
96
9297   rabbit_state(const machine_config &mconfig, device_type type, const char *tag)
9398      : driver_device(mconfig, type, tag),
9499      m_viewregs0(*this, "viewregs0"),
r22832r22833
140145   virtual void video_start();
141146   UINT32 screen_update_rabbit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
142147   INTERRUPT_GEN_MEMBER(rabbit_vblank_interrupt);
143   TIMER_CALLBACK_MEMBER(rabbit_blit_done);
144148   inline void get_rabbit_tilemap_info(tile_data &tileinfo, int tile_index, int whichtilemap, int tilesize);
145149   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
146150   void rabbit_clearspritebitmap( bitmap_ind16 &bitmap, const rectangle &cliprect );
r22832r22833
149153   void rabbit_do_blit();
150154   required_device<cpu_device> m_maincpu;
151155   required_device<eeprom_device> m_eeprom;
156
157protected:
158   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
152159};
153160
154161
r22832r22833
561568#define BLITCMDLOG 0
562569#define BLITLOG 0
563570
564TIMER_CALLBACK_MEMBER(rabbit_state::rabbit_blit_done)
571void rabbit_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
565572{
566   m_maincpu->set_input_line(m_bltirqlevel, HOLD_LINE);
573   switch (id)
574   {
575   case TIMER_BLIT_DONE:
576      m_maincpu->set_input_line(m_bltirqlevel, HOLD_LINE);
577      break;
578   default:
579      assert_always(FALSE, "Unknown id in rabbit_state::device_timer");
580   }
567581}
568582
569583void rabbit_state::rabbit_do_blit()
r22832r22833
610624            if (!blt_amount)
611625            {
612626               if(BLITLOG) mame_printf_debug("end of blit list\n");
613               machine().scheduler().timer_set(attotime::from_usec(500), timer_expired_delegate(FUNC(rabbit_state::rabbit_blit_done),this));
627               timer_set(attotime::from_usec(500), TIMER_BLIT_DONE);
614628               return;
615629            }
616630
trunk/src/mame/drivers/artmagic.c
r22832r22833
132132 *
133133 *************************************/
134134
135TIMER_CALLBACK_MEMBER(artmagic_state::irq_off)
135void artmagic_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
136136{
137   m_hack_irq = 0;
138   update_irq_state(machine());
137   switch (id)
138   {
139   case TIMER_IRQ_OFF:
140      m_hack_irq = 0;
141      update_irq_state(machine());
142      break;
143   default:
144      assert_always(FALSE, "Unknown id in artmagic_state::device_timer");
145   }
139146}
140147
148
141149READ16_MEMBER(artmagic_state::ultennis_hack_r)
142150{
143151   /* IRQ5 points to: jsr (a5); rte */
r22832r22833
146154   {
147155      m_hack_irq = 1;
148156      update_irq_state(machine());
149      machine().scheduler().timer_set(attotime::from_usec(1), timer_expired_delegate(FUNC(artmagic_state::irq_off),this));
157      timer_set(attotime::from_usec(1), TIMER_IRQ_OFF);
150158   }
151159   return ioport("300000")->read();
152160}
trunk/src/mame/drivers/thayers.c
r22832r22833
3535class thayers_state : public driver_device
3636{
3737public:
38   enum
39   {
40      TIMER_INTRQ_TICK,
41      TIMER_SSI263_PHONEME_TICK
42   };
43
3844   thayers_state(const machine_config &mconfig, device_type type, const char *tag)
3945      : driver_device(mconfig, type, tag),
4046         m_pr7820(*this, "laserdisc"),
r22832r22833
8389   DECLARE_CUSTOM_INPUT_MEMBER(laserdisc_ready_r);
8490   virtual void machine_start();
8591   virtual void machine_reset();
86   TIMER_CALLBACK_MEMBER(intrq_tick);
87   TIMER_CALLBACK_MEMBER(ssi263_phoneme_tick);
8892   void check_interrupt();
8993   required_device<cpu_device> m_maincpu;
94
95protected:
96   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
9097};
9198
9299
r22832r22833
98105
99106/* Interrupts */
100107
108void thayers_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
109{
110   switch (id)
111   {
112   case TIMER_INTRQ_TICK:
113      m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
114      break;
115   case TIMER_SSI263_PHONEME_TICK:
116      m_ssi_data_request = 0;
117      check_interrupt();
118      break;
119   default:
120      assert_always(FALSE, "Unknown id in thayers_state::device_timer");
121   }
122}
123
101124void thayers_state::check_interrupt()
102125{
103126   if (!m_timer_int || !m_data_rdy_int || !m_ssi_data_request)
r22832r22833
110133   }
111134}
112135
113TIMER_CALLBACK_MEMBER(thayers_state::intrq_tick)
114{
115   m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
116}
117
118136WRITE8_MEMBER(thayers_state::intrq_w)
119137{
120138   // T = 1.1 * R30 * C53 = 1.1 * 750K * 0.01uF = 8.25 ms
121139
122140   m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
123141
124   machine().scheduler().timer_set(attotime::from_usec(8250), timer_expired_delegate(FUNC(thayers_state::intrq_tick),this));
142   timer_set(attotime::from_usec(8250), TIMER_INTRQ_TICK);
125143}
126144
127145READ8_MEMBER(thayers_state::irqstate_r)
r22832r22833
474492   "L", "L1", "LF", "W", "B", "D", "KV", "P", "T", "K", "HV", "HVC", "HF", "HFC", "HN", "Z", "S", "J", "SCH", "V", "F", "THV", "TH", "M", "N", "NG", ":A", ":OH", ":U", ":UH", "E2", "LB"
475493};
476494
477TIMER_CALLBACK_MEMBER(thayers_state::ssi263_phoneme_tick)
478{
479   m_ssi_data_request = 0;
480   check_interrupt();
481}
482
483495WRITE8_MEMBER(thayers_state::ssi263_register_w)
484496{
485497   struct ssi263_t &ssi263 = m_ssi263;
r22832r22833
502514      case 0:
503515      case 1:
504516         // phoneme timing response
505         machine().scheduler().timer_set(attotime::from_usec(phoneme_time), timer_expired_delegate(FUNC(thayers_state::ssi263_phoneme_tick),this));
517         timer_set(attotime::from_usec(phoneme_time), TIMER_SSI263_PHONEME_TICK);
506518         break;
507519      case 2:
508520         // frame timing response
509         machine().scheduler().timer_set(attotime::from_usec(frame_time), timer_expired_delegate(FUNC(thayers_state::ssi263_phoneme_tick),this));
521         timer_set(attotime::from_usec(frame_time), TIMER_SSI263_PHONEME_TICK);
510522         break;
511523      case 3:
512524         // disable A/_R output
trunk/src/mame/drivers/firetrk.c
r22832r22833
5555}
5656
5757
58void firetrk_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
59{
60   switch (id)
61   {
62   case TIMER_PERIODIC:
63      periodic_callback(ptr, param);
64      break;
65   default:
66      assert_always(FALSE, "Unknown id in firetrk_state::device_timer");
67   }
68}
69
70
5871TIMER_CALLBACK_MEMBER(firetrk_state::periodic_callback)
5972{
6073   int scanline = param;
r22832r22833
6780   if (scanline > 262)
6881      scanline = 0;
6982
70   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(firetrk_state::periodic_callback),this), scanline);
83   timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_PERIODIC, scanline);
7184}
7285
7386
trunk/src/mame/drivers/gpworld.c
r22832r22833
4747class gpworld_state : public driver_device
4848{
4949public:
50   enum
51   {
52      TIMER_IRQ_STOP
53   };
54
5055   gpworld_state(const machine_config &mconfig, device_type type, const char *tag)
5156      : driver_device(mconfig, type, tag),
5257         m_laserdisc(*this, "laserdisc") ,
r22832r22833
7479   virtual void machine_start();
7580   UINT32 screen_update_gpworld(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7681   INTERRUPT_GEN_MEMBER(vblank_callback_gpworld);
77   TIMER_CALLBACK_MEMBER(irq_stop);
7882   void gpworld_draw_tiles(bitmap_rgb32 &bitmap,const rectangle &cliprect);
7983   inline void draw_pixel(bitmap_rgb32 &bitmap,const rectangle &cliprect,int x,int y,int color,int flip);
8084   void gpworld_draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect);
8185   required_device<cpu_device> m_maincpu;
86
87protected:
88   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
8289};
8390
8491
r22832r22833
429436   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
430437INPUT_PORTS_END
431438
432TIMER_CALLBACK_MEMBER(gpworld_state::irq_stop)
439void gpworld_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
433440{
434   m_maincpu->set_input_line(0, CLEAR_LINE);
441   switch (id)
442   {
443   case TIMER_IRQ_STOP:
444      m_maincpu->set_input_line(0, CLEAR_LINE);
445      break;
446   default:
447      assert_always(FALSE, "Unknown id in gpworld_state::device_timer");
448   }
435449}
436450
437451INTERRUPT_GEN_MEMBER(gpworld_state::vblank_callback_gpworld)
r22832r22833
446460
447461   /* The time the IRQ line stays high is set just long enough to happen after the NMI - hacky? */
448462   device.execute().set_input_line(0, ASSERT_LINE);
449   machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(gpworld_state::irq_stop),this));
463   timer_set(attotime::from_usec(100), TIMER_IRQ_STOP);
450464}
451465
452466static const gfx_layout gpworld_tile_layout =
trunk/src/mame/drivers/mlanding.c
r22832r22833
3333class mlanding_state : public driver_device
3434{
3535public:
36   enum
37   {
38      TIMER_DMA_COMPLETE
39   };
40
3641   mlanding_state(const machine_config &mconfig, device_type type, const char *tag)
3742      : driver_device(mconfig, type, tag),
3843      m_maincpu(*this, "maincpu"),
r22832r22833
95100   virtual void machine_start();
96101   virtual void video_start();
97102   UINT32 screen_update_mlanding(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
98   TIMER_CALLBACK_MEMBER(dma_complete);
99103   int start_dma();
100104   DECLARE_WRITE_LINE_MEMBER(ml_msm5205_vck);
105
106protected:
107   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
101108};
102109
103110
r22832r22833
306313   m_adpcm_trigger ^= 1;
307314}
308315
309TIMER_CALLBACK_MEMBER(mlanding_state::dma_complete)
316void mlanding_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
310317{
311   m_dma_active = 0;
318   switch (id)
319   {
320   case TIMER_DMA_COMPLETE:
321      m_dma_active = 0;
322      break;
323   default:
324      assert_always(FALSE, "Unknown id in mlanding_state::device_timer");
325   }
312326}
313327
314328/* TODO: this uses many bits */
r22832r22833
322336   if (pixels)
323337   {
324338      m_dma_active = 1;
325      machine().scheduler().timer_set(attotime::from_msec(20), timer_expired_delegate(FUNC(mlanding_state::dma_complete),this));
339      timer_set(attotime::from_msec(20), TIMER_DMA_COMPLETE);
326340   }
327341
328342   // 0 (falling edge?) starts cpus in this order:
trunk/src/mame/drivers/galastrm.c
r22832r22833
5454   device.execute().set_input_line(5, HOLD_LINE);
5555}
5656
57TIMER_CALLBACK_MEMBER(galastrm_state::galastrm_interrupt6)
57void galastrm_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
5858{
59   m_maincpu->set_input_line(6, HOLD_LINE);
59   switch (id)
60   {
61   case TIMER_GALASTRM_INTERRUPT6:
62      m_maincpu->set_input_line(6, HOLD_LINE);
63      break;
64   default:
65      assert_always(FALSE, "Unknown id in galastrm_state::device_timer");
66   }
6067}
6168
6269
63
6470WRITE32_MEMBER(galastrm_state::galastrm_palette_w)
6571{
6672   if (ACCESSING_BITS_16_31)
r22832r22833
156162
157163WRITE32_MEMBER(galastrm_state::galastrm_adstick_ctrl_w)
158164{
159   machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), timer_expired_delegate(FUNC(galastrm_state::galastrm_interrupt6),this));
165   timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), TIMER_GALASTRM_INTERRUPT6);
160166}
161167
162168/***********************************************************
trunk/src/mame/drivers/toypop.c
r22832r22833
7878   m_sound_irq_mask = 0;
7979}
8080
81void toypop_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
82{
83   switch (id)
84   {
85   case TIMER_NAMCOIO_RUN:
86      namcoio_run(ptr, param);
87      break;
88   default:
89      assert_always(FALSE, "Unknown id in toypop_state::device_timer");
90   }
91}
92
8193TIMER_CALLBACK_MEMBER(toypop_state::namcoio_run)
8294{
8395   device_t *io58xx = machine().device("58xx");
r22832r22833
108120      device.execute().set_input_line(0, HOLD_LINE);
109121
110122   if (!namcoio_read_reset_line(namcoio_0))        /* give the cpu a tiny bit of time to write the command before processing it */
111      machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(toypop_state::namcoio_run),this));
123      timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN);
112124
113125   if (!namcoio_read_reset_line(namcoio_1))        /* give the cpu a tiny bit of time to write the command before processing it */
114      machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(toypop_state::namcoio_run),this), 1);
126      timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN, 1);
115127
116128   if (!namcoio_read_reset_line(namcoio_2))        /* give the cpu a tiny bit of time to write the command before processing it */
117      machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(toypop_state::namcoio_run),this), 2);
129      timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN, 2);
118130
119131}
120132
trunk/src/mame/drivers/gunbustr.c
r22832r22833
5252
5353/*********************************************************************/
5454
55TIMER_CALLBACK_MEMBER(gunbustr_state::gunbustr_interrupt5)
55void gunbustr_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
5656{
57   m_maincpu->set_input_line(5, HOLD_LINE);
57   switch (id)
58   {
59   case TIMER_GUNBUSTR_INTERRUPT5:
60      m_maincpu->set_input_line(5, HOLD_LINE);
61      break;
62   default:
63      assert_always(FALSE, "Unknown id in gunbustr_state::device_timer");
64   }
5865}
5966
6067INTERRUPT_GEN_MEMBER(gunbustr_state::gunbustr_interrupt)
6168{
62   machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000-500), timer_expired_delegate(FUNC(gunbustr_state::gunbustr_interrupt5),this));
69   timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000-500), TIMER_GUNBUSTR_INTERRUPT5);
6370   device.execute().set_input_line(4, HOLD_LINE);
6471}
6572
r22832r22833
142149WRITE32_MEMBER(gunbustr_state::gunbustr_gun_w)
143150{
144151   /* 10000 cycle delay is arbitrary */
145   machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), timer_expired_delegate(FUNC(gunbustr_state::gunbustr_interrupt5),this));
152   timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), TIMER_GUNBUSTR_INTERRUPT5);
146153}
147154
148155
trunk/src/mame/drivers/capbowl.c
r22832r22833
119119 *
120120 *************************************/
121121
122void capbowl_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
123{
124   switch (id)
125   {
126   case TIMER_CAPBOWL_UPDATE:
127      capbowl_update(ptr, param);
128      break;
129   default:
130      assert_always(FALSE, "Unknown id in capbowl_state::device_timer");
131   }
132}
133
134
122135TIMER_CALLBACK_MEMBER(capbowl_state::capbowl_update)
123136{
124137   int scanline = param;
r22832r22833
126139   machine().primary_screen->update_partial(scanline - 1);
127140   scanline += 32;
128141   if (scanline > 240) scanline = 32;
129   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(capbowl_state::capbowl_update),this), scanline);
142   timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_CAPBOWL_UPDATE, scanline);
130143}
131144
132145
r22832r22833
338351
339352void capbowl_state::machine_reset()
340353{
341   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(32), timer_expired_delegate(FUNC(capbowl_state::capbowl_update),this), 32);
354   timer_set(machine().primary_screen->time_until_pos(32), TIMER_CAPBOWL_UPDATE, 32);
342355
343356   m_blitter_addr = 0;
344357   m_last_trackball_val[0] = 0;
trunk/src/mame/includes/mappy.h
r22832r22833
33class mappy_state : public driver_device
44{
55public:
6   enum
7   {
8      TIMER_SUPERPAC_IO_RUN,
9      TIMER_PACNPAL_IO_RUN,
10      TIMER_PHOZON_IO_RUN,
11      TIMER_MAPPY_IO_RUN
12   };
13
614   mappy_state(const machine_config &mconfig, device_type type, const char *tag)
715      : driver_device(mconfig, type, tag),
816      m_videoram(*this, "videoram"),
r22832r22833
7482   required_device<cpu_device> m_subcpu;
7583   optional_device<cpu_device> m_subcpu2;
7684   optional_device<dac_device> m_dac;
85
86protected:
87   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
7788};
trunk/src/mame/includes/toaplan2.h
r22832r22833
1313class toaplan2_state : public driver_device
1414{
1515public:
16   enum
17   {
18      TIMER_RAISE_IRQ
19   };
20
1621   toaplan2_state(const machine_config &mconfig, device_type type, const char *tag)
1722      : driver_device(mconfig, type, tag),
1823      m_shared_ram(*this, "shared_ram"),
r22832r22833
145150   optional_device<okim6295_device> m_oki;
146151   optional_device<okim6295_device> m_oki1;
147152   optional_device<eeprom_device> m_eeprom;
153
154protected:
155   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
148156};
trunk/src/mame/includes/galastrm.h
r22832r22833
1414class galastrm_state : public driver_device
1515{
1616public:
17   enum
18   {
19      TIMER_GALASTRM_INTERRUPT6
20   };
21
1722   galastrm_state(const machine_config &mconfig, device_type type, const char *tag)
1823      : driver_device(mconfig, type, tag),
1924      m_ram(*this,"ram"),
r22832r22833
5257   virtual void video_start();
5358   UINT32 screen_update_galastrm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5459   INTERRUPT_GEN_MEMBER(galastrm_interrupt);
55   TIMER_CALLBACK_MEMBER(galastrm_interrupt6);
5660   void galastrm_exit();
5761   void draw_sprites_pre(int x_offs, int y_offs);
5862   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int *primasks, int priority);
5963   void tc0610_rotate_draw(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, const rectangle &clip);
6064   required_device<cpu_device> m_maincpu;
6165   required_device<eeprom_device> m_eeprom;
66
67protected:
68   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
6269};
trunk/src/mame/includes/capbowl.h
r22832r22833
99class capbowl_state : public driver_device
1010{
1111public:
12   enum
13   {
14      TIMER_CAPBOWL_UPDATE
15   };
16
1217   capbowl_state(const machine_config &mconfig, device_type type, const char *tag)
1318      : driver_device(mconfig, type, tag),
1419      m_rowaddress(*this, "rowaddress"),
r22832r22833
4752   TIMER_CALLBACK_MEMBER(capbowl_update);
4853   inline rgb_t pen_for_pixel( UINT8 *src, UINT8 pix );
4954   DECLARE_WRITE_LINE_MEMBER(firqhandler);
55
56protected:
57   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5058};
trunk/src/mame/includes/fgoal.h
r22832r22833
33class fgoal_state : public driver_device
44{
55public:
6   enum
7   {
8      TIMER_INTERRUPT
9   };
10
611   fgoal_state(const machine_config &mconfig, device_type type, const char *tag)
712      : driver_device(mconfig, type, tag),
813      m_video_ram(*this, "video_ram"),
r22832r22833
5156   TIMER_CALLBACK_MEMBER(interrupt_callback);
5257   int intensity(int bits);
5358   unsigned video_ram_address(  );
59
60protected:
61   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5462};
trunk/src/mame/includes/thunderx.h
r22832r22833
88class thunderx_state : public driver_device
99{
1010public:
11   enum
12   {
13      TIMER_THUNDERX_FIRQ
14   };
15
1116   thunderx_state(const machine_config &mconfig, device_type type, const char *tag)
1217      : driver_device(mconfig, type, tag),
1318      m_ram(*this, "ram"),
r22832r22833
5863   DECLARE_MACHINE_RESET(thunderx);
5964   UINT32 screen_update_scontra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6065   INTERRUPT_GEN_MEMBER(scontra_interrupt);
61   TIMER_CALLBACK_MEMBER(thunderx_firq_callback);
6266   void run_collisions( int s0, int e0, int s1, int e1, int cm, int hm );
6367   void calculate_collisions(  );
6468   DECLARE_WRITE8_MEMBER(volume_callback);
69
70protected:
71   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
6572};
6673
6774
trunk/src/mame/includes/gunbustr.h
r22832r22833
1313class gunbustr_state : public driver_device
1414{
1515public:
16   enum
17   {
18      TIMER_GUNBUSTR_INTERRUPT5
19   };
20
1621   gunbustr_state(const machine_config &mconfig, device_type type, const char *tag)
1722      : driver_device(mconfig, type, tag),
1823      m_maincpu(*this,"maincpu"),
r22832r22833
4550   virtual void video_start();
4651   UINT32 screen_update_gunbustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4752   INTERRUPT_GEN_MEMBER(gunbustr_interrupt);
48   TIMER_CALLBACK_MEMBER(gunbustr_interrupt5);
4953   void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs);
54
55protected:
56   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5057};
trunk/src/mame/includes/taito_f2.h
r22832r22833
1212class taitof2_state : public driver_device
1313{
1414public:
15   enum
16   {
17      TIMER_TAITOF2_INTERRUPT6
18   };
19
1520   taitof2_state(const machine_config &mconfig, device_type type, const char *tag)
1621      : driver_device(mconfig, type, tag),
1722         m_sprite_extension(*this, "sprite_ext"),
r22832r22833
151156   void screen_eof_taitof2_full_buffer_delayed(screen_device &screen, bool state);
152157   void screen_eof_taitof2_partial_buffer_delayed_qzchikyu(screen_device &screen, bool state);
153158   INTERRUPT_GEN_MEMBER(taitof2_interrupt);
154   TIMER_CALLBACK_MEMBER(taitof2_interrupt6);
155159   void reset_driveout_sound_region();
156160   void taitof2_core_vh_start (int sprite_type, int hide, int flip_hide );
157161   void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int *primasks, int uses_tc360_mixer );
r22832r22833
160164   void taitof2_update_sprites_active_area(  );
161165   void draw_roz_layer( bitmap_ind16 &bitmap, const rectangle &cliprect, UINT32 priority);
162166   void taito_f2_tc360_spritemixdraw(bitmap_ind16 &dest_bmp, const rectangle &clip, gfx_element *gfx,
163      UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley );
167   UINT32 code, UINT32 color, int flipx, int flipy, int sx, int sy, int scalex, int scaley );
164168   DECLARE_WRITE_LINE_MEMBER(irqhandler);
169
170protected:
171   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
165172};
trunk/src/mame/includes/firetrk.h
r22832r22833
3333class firetrk_state : public driver_device
3434{
3535public:
36   enum
37   {
38      TIMER_PERIODIC
39   };
40
3641   firetrk_state(const machine_config &mconfig, device_type type, const char *tag)
3742      : driver_device(mconfig, type, tag),
3843      m_alpha_num_ram(*this, "alpha_num_ram"),
r22832r22833
123128   void check_collision(firetrk_state *state, int which);
124129   void set_service_mode(int enable);
125130   required_device<cpu_device> m_maincpu;
131
132protected:
133   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
126134};
127135
128136
trunk/src/mame/includes/asterix.h
r22832r22833
88class asterix_state : public driver_device
99{
1010public:
11   enum
12   {
13      TIMER_NMI
14   };
15
1116   asterix_state(const machine_config &mconfig, device_type type, const char *tag)
1217      : driver_device(mconfig, type, tag),
1318      m_maincpu(*this, "maincpu"),
r22832r22833
5156   virtual void machine_reset();
5257   UINT32 screen_update_asterix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5358   INTERRUPT_GEN_MEMBER(asterix_interrupt);
54   TIMER_CALLBACK_MEMBER(nmi_callback);
59
60protected:
61   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5562};
5663
5764/*----------- defined in video/asterix.c -----------*/
trunk/src/mame/includes/artmagic.h
r22832r22833
88class artmagic_state : public driver_device
99{
1010public:
11   enum
12   {
13      TIMER_IRQ_OFF
14   };
15
1116   artmagic_state(const machine_config &mconfig, device_type type, const char *tag)
1217      : driver_device(mconfig, type, tag),
1318      m_tlc34076(*this, "tlc34076"),
r22832r22833
5459   virtual void machine_start();
5560   virtual void machine_reset();
5661   virtual void video_start();
57   TIMER_CALLBACK_MEMBER(irq_off);
5862   required_device<cpu_device> m_maincpu;
5963   required_device<okim6295_device> m_oki;
64
65protected:
66   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
6067};
6168
6269
trunk/src/mame/includes/toypop.h
r22832r22833
11class toypop_state : public driver_device
22{
33public:
4   enum
5   {
6      TIMER_NAMCOIO_RUN
7   };
8
49   toypop_state(const machine_config &mconfig, device_type type, const char *tag)
510      : driver_device(mconfig, type, tag),
611      m_videoram(*this, "videoram"),
r22832r22833
6267   required_device<cpu_device> m_maincpu;
6368   required_device<cpu_device> m_audiocpu;
6469   required_device<cpu_device> m_subcpu;
70
71protected:
72   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
6573};
trunk/src/mame/includes/megadriv.h
r22832r22833
337337class mtech_state : public md_base_state
338338{
339339public:
340   enum
341   {
342      TIMER_Z80_RUN_STATE,
343      TIMER_Z80_STOP_STATE
344   };
345
340346   mtech_state(const machine_config &mconfig, device_type type, const char *tag)
341347   : md_base_state(mconfig, type, tag),
342348      m_vdp1(*this, "vdp1"),
r22832r22833
391397   DECLARE_WRITE8_MEMBER( megatech_bios_port_ctrl_w );
392398   DECLARE_READ8_MEMBER( megatech_bios_joypad_r );
393399   DECLARE_WRITE8_MEMBER (megatech_bios_port_7f_w);
400
401protected:
402   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
394403};
395404
396405class _32x_state : public md_base_state

Previous 199869 Revisions Next


© 1997-2024 The MAME Team