Previous 199869 Revisions Next

r22844 Wednesday 15th May, 2013 at 23:33:55 UTC by Andrew Gardner
A hanful more. (nw)
[src/mame/drivers]asuka.c dec8.c fuukifg3.c groundfx.c metro.c mgolf.c othunder.c rollerg.c skullxbo.c slapshot.c sprint4.c taito_f3.c taito_z.c tehkanwc.c tugboat.c undrfire.c vendetta.c
[src/mame/includes]asuka.h dec8.h fuukifg3.h groundfx.h metro.h othunder.h rollerg.h skullxbo.h slapshot.h sprint4.h taito_f3.h taito_z.h tehkanwc.h undrfire.h vendetta.h

trunk/src/mame/drivers/othunder.c
r22843r22844
277277   update_irq();
278278}
279279
280TIMER_CALLBACK_MEMBER(othunder_state::ad_interrupt)
280void othunder_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
281281{
282   m_ad_irq = 1;
283   update_irq();
282   switch (id)
283   {
284   case TIMER_AD_INTERRUPT:
285      m_ad_irq = 1;
286      update_irq();
287      break;
288   default:
289      assert_always(FALSE, "Unknown id in othunder_state::device_timer");
290   }
284291}
285292
286293
r22843r22844
374381      The ADC60808 clock is 512kHz. Conversion takes between 0 and 8 clock
375382      cycles, so would end in a maximum of 15.625us. We'll use 10. */
376383
377   machine().scheduler().timer_set(attotime::from_usec(10), timer_expired_delegate(FUNC(othunder_state::ad_interrupt),this));
384   timer_set(attotime::from_usec(10), TIMER_AD_INTERRUPT);
378385}
379386
380387
trunk/src/mame/drivers/vendetta.c
r22843r22844
194194   k053246_set_objcha_line(m_k053246, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
195195}
196196
197TIMER_CALLBACK_MEMBER(vendetta_state::z80_nmi_callback)
197void vendetta_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
198198{
199   m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
199   switch (id)
200   {
201   case TIMER_Z80_NMI:
202      m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
203      break;
204   default:
205      assert_always(FALSE, "Unknown id in vendetta_state::device_timer");
206   }
200207}
201208
202209WRITE8_MEMBER(vendetta_state::z80_arm_nmi_w)
203210{
204211   m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
205212
206   machine().scheduler().timer_set(attotime::from_usec(25), timer_expired_delegate(FUNC(vendetta_state::z80_nmi_callback),this));
213   timer_set(attotime::from_usec(25), TIMER_Z80_NMI);
207214}
208215
209216WRITE8_MEMBER(vendetta_state::z80_irq_w)
trunk/src/mame/drivers/taito_f3.c
r22843r22844
390390
391391/******************************************************************************/
392392
393TIMER_CALLBACK_MEMBER(taito_f3_state::f3_interrupt3)
393void taito_f3_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
394394{
395   m_maincpu->set_input_line(3, HOLD_LINE);    // some signal from video hardware?
395   switch (id)
396   {
397   case TIMER_F3_INTERRUPT3:
398      m_maincpu->set_input_line(3, HOLD_LINE);    // some signal from video hardware?
399      break;
400   default:
401      assert_always(FALSE, "Unknown id in taito_f3_state::device_timer");
402   }
396403}
397404
398405INTERRUPT_GEN_MEMBER(taito_f3_state::f3_interrupt2)
399406{
400407   device.execute().set_input_line(2, HOLD_LINE);  // vblank
401   machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(10000), timer_expired_delegate(FUNC(taito_f3_state::f3_interrupt3),this));
408   timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(10000), TIMER_F3_INTERRUPT3);
402409}
403410
404411static SOUND_RESET( f3 )
trunk/src/mame/drivers/fuukifg3.c
r22843r22844
521521
522522***************************************************************************/
523523
524TIMER_CALLBACK_MEMBER(fuuki32_state::level_1_interrupt_callback)
524void fuuki32_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
525525{
526   m_maincpu->set_input_line(1, HOLD_LINE);
527   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(248), timer_expired_delegate(FUNC(fuuki32_state::level_1_interrupt_callback),this));
526   switch (id)
527   {
528   case TIMER_LEVEL_1_INTERRUPT:
529      m_maincpu->set_input_line(1, HOLD_LINE);
530      timer_set(machine().primary_screen->time_until_pos(248), TIMER_LEVEL_1_INTERRUPT);
531      break;
532   case TIMER_VBLANK_INTERRUPT:
533      m_maincpu->set_input_line(3, HOLD_LINE);    // VBlank IRQ
534      timer_set(machine().primary_screen->time_until_vblank_start(), TIMER_VBLANK_INTERRUPT);
535      break;
536   case TIMER_RASTER_INTERRUPT:
537      m_maincpu->set_input_line(5, HOLD_LINE);    // Raster Line IRQ
538      machine().primary_screen->update_partial(machine().primary_screen->vpos());
539      m_raster_interrupt_timer->adjust(machine().primary_screen->frame_period());
540      break;
541   default:
542      assert_always(FALSE, "Unknown id in fuuki32_state::device_timer");
543   }
528544}
529545
530546
531TIMER_CALLBACK_MEMBER(fuuki32_state::vblank_interrupt_callback)
532{
533   m_maincpu->set_input_line(3, HOLD_LINE);    // VBlank IRQ
534   machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_start(), timer_expired_delegate(FUNC(fuuki32_state::vblank_interrupt_callback),this));
535}
536
537
538TIMER_CALLBACK_MEMBER(fuuki32_state::raster_interrupt_callback)
539{
540   m_maincpu->set_input_line(5, HOLD_LINE);    // Raster Line IRQ
541   machine().primary_screen->update_partial(machine().primary_screen->vpos());
542   m_raster_interrupt_timer->adjust(machine().primary_screen->frame_period());
543}
544
545
546547void fuuki32_state::machine_start()
547548{
548549   UINT8 *ROM = memregion("soundcpu")->base();
549550
550551   membank("bank1")->configure_entries(0, 0x10, &ROM[0x10000], 0x8000);
551552
552   m_raster_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fuuki32_state::raster_interrupt_callback),this));
553   m_raster_interrupt_timer = timer_alloc(TIMER_RASTER_INTERRUPT);
553554
554555   save_item(NAME(m_spr_buffered_tilebank));
555556   save_item(NAME(m_shared_ram));
r22843r22844
560561{
561562   const rectangle &visarea = machine().primary_screen->visible_area();
562563
563   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(248), timer_expired_delegate(FUNC(fuuki32_state::level_1_interrupt_callback),this));
564   machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_start(), timer_expired_delegate(FUNC(fuuki32_state::vblank_interrupt_callback),this));
564   timer_set(machine().primary_screen->time_until_pos(248), TIMER_LEVEL_1_INTERRUPT);
565   timer_set(machine().primary_screen->time_until_vblank_start(), TIMER_VBLANK_INTERRUPT);
565566   m_raster_interrupt_timer->adjust(machine().primary_screen->time_until_pos(0, visarea.max_x + 1));
566567}
567568
trunk/src/mame/drivers/sprint4.c
r22843r22844
4141}
4242
4343
44void sprint4_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
45{
46   switch (id)
47   {
48   case TIMER_NMI:
49      nmi_callback(ptr, param);
50      break;
51   default:
52      assert_always(FALSE, "Unknown id in sprint4_state::device_timer");
53   }
54}
55
56
4457TIMER_CALLBACK_MEMBER(sprint4_state::nmi_callback)
4558{
4659   int scanline = param;
r22843r22844
103116   if (ioport("IN0")->read() & 0x40)
104117      m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
105118
106   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(sprint4_state::nmi_callback),this), scanline);
119   timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_NMI, scanline);
107120}
108121
109122
110123void sprint4_state::machine_reset()
111124{
112   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(32), timer_expired_delegate(FUNC(sprint4_state::nmi_callback),this), 32);
125   timer_set(machine().primary_screen->time_until_pos(32), TIMER_NMI, 32);
113126
114127   memset(m_steer_FF1, 0, sizeof m_steer_FF1);
115128   memset(m_steer_FF2, 0, sizeof m_steer_FF2);
trunk/src/mame/drivers/tehkanwc.c
r22843r22844
144144   m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
145145}
146146
147TIMER_CALLBACK_MEMBER(tehkanwc_state::reset_callback)
147void tehkanwc_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
148148{
149   m_audiocpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
149   switch (id)
150   {
151   case TIMER_RESET:
152      m_audiocpu->set_input_line(INPUT_LINE_RESET, PULSE_LINE);
153      break;
154   default:
155      assert_always(FALSE, "Unknown id in tehkanwc_state::device_timer");
156   }
150157}
151158
152159WRITE8_MEMBER(tehkanwc_state::sound_answer_w)
r22843r22844
155162
156163   /* in Gridiron, the sound CPU goes in a tight loop after the self test, */
157164   /* probably waiting to be reset by a watchdog */
158   if (space.device().safe_pc() == 0x08bc) machine().scheduler().timer_set(attotime::from_seconds(1), timer_expired_delegate(FUNC(tehkanwc_state::reset_callback),this));
165   if (space.device().safe_pc() == 0x08bc) timer_set(attotime::from_seconds(1), TIMER_RESET);
159166}
160167
161168
trunk/src/mame/drivers/asuka.c
r22843r22844
230230                INTERRUPTS
231231***********************************************************/
232232
233TIMER_CALLBACK_MEMBER(asuka_state::cadash_interrupt5)
233void asuka_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
234234{
235   m_maincpu->set_input_line(5, HOLD_LINE);
235   switch (id)
236   {
237   case TIMER_CADASH_INTERRUPT5:
238      m_maincpu->set_input_line(5, HOLD_LINE);
239      break;
240   default:
241      assert_always(FALSE, "Unknown id in asuka_state::device_timer");
242   }
236243}
237244
245
238246INTERRUPT_GEN_MEMBER(asuka_state::cadash_interrupt)
239247{
240   machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(500), timer_expired_delegate(FUNC(asuka_state::cadash_interrupt5),this));
248   timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(500), TIMER_CADASH_INTERRUPT5);
241249   device.execute().set_input_line(4, HOLD_LINE);  /* interrupt vector 4 */
242250}
243251
trunk/src/mame/drivers/mgolf.c
r22843r22844
1010class mgolf_state : public driver_device
1111{
1212public:
13   enum
14   {
15      TIMER_INTERRUPT
16   };
17
1318   mgolf_state(const machine_config &mconfig, device_type type, const char *tag)
1419      : driver_device(mconfig, type, tag),
1520      m_video_ram(*this, "video_ram"),
r22843r22844
4348   TIMER_CALLBACK_MEMBER(interrupt_callback);
4449   void update_plunger(  );
4550   double calc_plunger_pos();
51
52protected:
53   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
4654};
4755
4856
r22843r22844
116124}
117125
118126
127void mgolf_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
128{
129   switch (id)
130   {
131   case TIMER_INTERRUPT:
132      interrupt_callback(ptr, param);
133      break;
134   default:
135      assert_always(FALSE, "Unknown id in mgolf_state::device_timer");
136   }
137}
138
139
119140TIMER_CALLBACK_MEMBER(mgolf_state::interrupt_callback)
120141{
121142   int scanline = param;
r22843r22844
129150   if (scanline >= 262)
130151      scanline = 16;
131152
132   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(mgolf_state::interrupt_callback),this), scanline);
153   timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_INTERRUPT, scanline);
133154}
134155
135156
r22843r22844
314335
315336void mgolf_state::machine_reset()
316337{
317   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(16), timer_expired_delegate(FUNC(mgolf_state::interrupt_callback),this), 16);
338   timer_set(machine().primary_screen->time_until_pos(16), TIMER_INTERRUPT, 16);
318339
319340   m_mask = 0;
320341   m_prev = 0;
trunk/src/mame/drivers/taito_z.c
r22843r22844
10161016                        INTERRUPTS
10171017***********************************************************/
10181018
1019/* 68000 A */
1020
1021TIMER_CALLBACK_MEMBER(taitoz_state::taitoz_interrupt6)
1019void taitoz_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
10221020{
1023   m_maincpu->set_input_line(6, HOLD_LINE);
1021   switch (id)
1022   {
1023   case TIMER_TAITOZ_INTERRUPT6:
1024      /* 68000 A */
1025      m_maincpu->set_input_line(6, HOLD_LINE);
1026      break;
1027   case TIMER_TAITOZ_CPUB_INTERRUPT5:
1028      /* 68000 B */
1029      m_subcpu->set_input_line(5, HOLD_LINE);
1030      break;
1031   default:
1032      assert_always(FALSE, "Unknown id in taitoz_state::device_timer");
1033   }
10241034}
10251035
1026/* 68000 B */
10271036
1028TIMER_CALLBACK_MEMBER(taitoz_state::taitoz_cpub_interrupt5)
1029{
1030   m_subcpu->set_input_line(5, HOLD_LINE);
1031}
1032
1033
10341037/***** Routines for particular games *****/
10351038
10361039INTERRUPT_GEN_MEMBER(taitoz_state::sci_interrupt)
r22843r22844
10421045   m_sci_int6 = !m_sci_int6;
10431046
10441047   if (m_sci_int6)
1045      machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000 - 500), timer_expired_delegate(FUNC(taitoz_state::taitoz_interrupt6),this));
1048      timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000 - 500), TIMER_TAITOZ_INTERRUPT6);
10461049
10471050   device.execute().set_input_line(4, HOLD_LINE);
10481051}
r22843r22844
12261229      but we don't want CPUA to have an int6 before int4 is over (?)
12271230   */
12281231
1229   machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), timer_expired_delegate(FUNC(taitoz_state::taitoz_interrupt6),this));
1232   timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), TIMER_TAITOZ_INTERRUPT6);
12301233}
12311234
12321235
r22843r22844
12911294      Four lightgun interrupts happen before the collected coords
12921295      are moved to shared ram where CPUA can use them. */
12931296
1294   machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), timer_expired_delegate(FUNC(taitoz_state::taitoz_cpub_interrupt5),this));
1297   timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), TIMER_TAITOZ_CPUB_INTERRUPT5);
12951298}
12961299
12971300WRITE16_MEMBER(taitoz_state::spacegun_gun_output_w)
trunk/src/mame/drivers/slapshot.c
r22843r22844
171171                INTERRUPTS
172172***********************************************************/
173173
174TIMER_CALLBACK_MEMBER(slapshot_state::slapshot_interrupt6)
174void slapshot_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
175175{
176   m_maincpu->set_input_line(6, HOLD_LINE);
176   switch (id)
177   {
178   case TIMER_SLAPSHOT_INTERRUPT6:
179      m_maincpu->set_input_line(6, HOLD_LINE);
180      break;
181   default:
182      assert_always(FALSE, "Unknown id in slapshot_state::device_timer");
183   }
177184}
178185
179186
180187INTERRUPT_GEN_MEMBER(slapshot_state::slapshot_interrupt)
181188{
182   machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000 - 500), timer_expired_delegate(FUNC(slapshot_state::slapshot_interrupt6),this));
189   timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(200000 - 500), TIMER_SLAPSHOT_INTERRUPT6);
183190   device.execute().set_input_line(5, HOLD_LINE);
184191}
185192
trunk/src/mame/drivers/rollerg.c
r22843r22844
5959   m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
6060}
6161
62TIMER_CALLBACK_MEMBER(rollerg_state::nmi_callback)
62void rollerg_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
6363{
64   m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
64   switch (id)
65   {
66   case TIMER_NMI:
67      m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
68      break;
69   default:
70      assert_always(FALSE, "Unknown id in rollerg_state::device_timer");
71   }
6572}
6673
6774WRITE8_MEMBER(rollerg_state::sound_arm_nmi_w)
6875{
6976   m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
70   machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(rollerg_state::nmi_callback),this));   /* kludge until the K053260 is emulated correctly */
77   timer_set(attotime::from_usec(50), TIMER_NMI);   /* kludge until the K053260 is emulated correctly */
7178}
7279
7380READ8_MEMBER(rollerg_state::pip_r)
trunk/src/mame/drivers/groundfx.c
r22843r22844
9898                INTERRUPTS
9999***********************************************************/
100100
101TIMER_CALLBACK_MEMBER(groundfx_state::groundfx_interrupt5)
101void groundfx_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
102102{
103   m_maincpu->set_input_line(5, HOLD_LINE); //from 5... ADC port
103   switch (id)
104   {
105   case TIMER_GROUNDFX_INTERRUPT5:
106      m_maincpu->set_input_line(5, HOLD_LINE); //from 5... ADC port
107      break;
108   default:
109      assert_always(FALSE, "Unknown id in groundfx_state::device_timer");
110   }
104111}
105112
106113
r22843r22844
173180{
174181   /* One interrupt per input port (4 per frame, though only 2 used).
175182       1000 cycle delay is arbitrary */
176   machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), timer_expired_delegate(FUNC(groundfx_state::groundfx_interrupt5),this));
183   timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), TIMER_GROUNDFX_INTERRUPT5);
177184}
178185
179186WRITE32_MEMBER(groundfx_state::rotate_control_w)/* only a guess that it's rotation */
trunk/src/mame/drivers/metro.c
r22843r22844
194194   update_irq_state();
195195}
196196
197void metro_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
198{
199   switch (id)
200   {
201   case TIMER_KARATOUR_IRQ:
202      m_requested_int[5] = 0;
203      break;
204   case TIMER_MOUJA_IRQ:
205      m_requested_int[0] = 1;
206      update_irq_state();
207      break;
208   case TIMER_METRO_BLIT_DONE:
209      metro_blit_done(ptr, param);
210      break;
211   default:
212      assert_always(FALSE, "Unknown id in metro_state::device_timer");
213   }
214}
215
197216INTERRUPT_GEN_MEMBER(metro_state::metro_vblank_interrupt)
198217{
199218   m_requested_int[m_vblank_bit] = 1;
r22843r22844
206225   update_irq_state();
207226}
208227
209TIMER_CALLBACK_MEMBER(metro_state::karatour_irq_callback)
210{
211   m_requested_int[5] = 0;
212}
213
214228/* lev 2-7 (lev 1 seems sound related) */
215229INTERRUPT_GEN_MEMBER(metro_state::karatour_interrupt)
216230{
217231   m_requested_int[m_vblank_bit] = 1;
218232
219233   /* write to scroll registers, the duration is a guess */
220   machine().scheduler().timer_set(attotime::from_usec(2500), timer_expired_delegate(FUNC(metro_state::karatour_irq_callback),this));
234   timer_set(attotime::from_usec(2500), TIMER_KARATOUR_IRQ);
221235   m_requested_int[5] = 1;
222236
223237   update_irq_state();
224238}
225239
226TIMER_CALLBACK_MEMBER(metro_state::mouja_irq_callback)
227{
228   m_requested_int[0] = 1;
229   update_irq_state();
230}
231
232240WRITE16_MEMBER(metro_state::mouja_irq_timer_ctrl_w)
233241{
234242   double freq = 58.0 + (0xff - (data & 0xff)) / 2.2; /* 0xff=58Hz, 0x80=116Hz? */
r22843r22844
620628                   another blit. */
621629            if (b1 == 0)
622630            {
623               machine().scheduler().timer_set(attotime::from_usec(500), timer_expired_delegate(FUNC(metro_state::metro_blit_done),this));
631               timer_set(attotime::from_usec(500), TIMER_METRO_BLIT_DONE);
624632               return;
625633            }
626634
r22843r22844
63406348   metro_common();
63416349   m_irq_line = -1;    /* split interrupt handlers */
63426350   m_vblank_bit = 1;
6343   m_mouja_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(metro_state::mouja_irq_callback),this));
6351   m_mouja_irq_timer = timer_alloc(TIMER_MOUJA_IRQ);
63446352}
63456353
63466354DRIVER_INIT_MEMBER(metro_state,gakusai)
trunk/src/mame/drivers/undrfire.c
r22843r22844
225225                INTERRUPTS
226226***********************************************************/
227227
228TIMER_CALLBACK_MEMBER(undrfire_state::interrupt5)
228void undrfire_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
229229{
230   m_maincpu->set_input_line(5, HOLD_LINE);
230   switch (id)
231   {
232   case TIMER_INTERRUPT5:
233      m_maincpu->set_input_line(5, HOLD_LINE);
234      break;
235   default:
236      assert_always(FALSE, "Unknown id in undrfire_state::device_timer");
237   }
231238}
232239
233240
r22843r22844
358365WRITE32_MEMBER(undrfire_state::unknown_int_req_w)
359366{
360367   /* 10000 cycle delay is arbitrary */
361   machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), timer_expired_delegate(FUNC(undrfire_state::interrupt5),this));
368   timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(10000), TIMER_INTERRUPT5);
362369}
363370
364371
r22843r22844
463470{
464471   /* One interrupt per input port (4 per frame, though only 2 used).
465472       1000 cycle delay is arbitrary */
466   machine().scheduler().timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), timer_expired_delegate(FUNC(undrfire_state::interrupt5),this));
473   timer_set(downcast<cpu_device *>(&space.device())->cycles_to_attotime(1000), TIMER_INTERRUPT5);
467474}
468475
469476/***********************************************************
trunk/src/mame/drivers/dec8.c
r22843r22844
132132*
133133***************************************************/
134134
135TIMER_CALLBACK_MEMBER(dec8_state::dec8_i8751_timer_callback)
135void dec8_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
136136{
137   // The schematics show a clocked LS194 shift register (3A) is used to automatically
138   // clear the IRQ request.  The MCU does not clear it itself.
139   m_mcu->set_input_line(MCS51_INT1_LINE, CLEAR_LINE);
137   switch (id)
138   {
139   case TIMER_DEC8_I8751:
140      // The schematics show a clocked LS194 shift register (3A) is used to automatically
141      // clear the IRQ request.  The MCU does not clear it itself.
142      m_mcu->set_input_line(MCS51_INT1_LINE, CLEAR_LINE);
143      break;
144   default:
145      assert_always(FALSE, "Unknown id in dec8_state::device_timer");
146   }
140147}
141148
142149WRITE8_MEMBER(dec8_state::dec8_i8751_w)
r22843r22844
146153   case 0: /* High byte - SECIRQ is trigged on activating this latch */
147154      m_i8751_value = (m_i8751_value & 0xff) | (data << 8);
148155      m_mcu->set_input_line(MCS51_INT1_LINE, ASSERT_LINE);
149      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
156      timer_set(m_mcu->clocks_to_attotime(64), TIMER_DEC8_I8751); // 64 clocks not confirmed
150157      break;
151158   case 1: /* Low byte */
152159      m_i8751_value = (m_i8751_value & 0xff00) | data;
trunk/src/mame/drivers/skullxbo.c
r22843r22844
3939}
4040
4141
42TIMER_CALLBACK_MEMBER(skullxbo_state::irq_gen)
42void skullxbo_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
4343{
44   scanline_int_gen(m_maincpu);
44   switch (id)
45   {
46   case TIMER_IRQ_GEN:
47      scanline_int_gen(m_maincpu);
48      break;
49   default:
50      assert_always(FALSE, "Unknown id in skullxbo_state::device_timer");
51   }
4552}
4653
4754
r22843r22844
5562   {
5663      int width = screen.width();
5764      attotime period = screen.time_until_pos(screen.vpos() + 6, width * 0.9);
58      machine().scheduler().timer_set(period, timer_expired_delegate(FUNC(skullxbo_state::irq_gen), this));
65      timer_set(period, TIMER_IRQ_GEN);
5966   }
6067
6168   /* update the playfield and motion objects */
trunk/src/mame/drivers/tugboat.c
r22843r22844
3131class tugboat_state : public driver_device
3232{
3333public:
34   enum
35   {
36      TIMER_INTERRUPT
37   };
38
3439   tugboat_state(const machine_config &mconfig, device_type type, const char *tag)
3540      : driver_device(mconfig, type, tag),
3641      m_ram(*this, "ram"),
r22843r22844
5156   virtual void machine_reset();
5257   virtual void palette_init();
5358   UINT32 screen_update_tugboat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
54   TIMER_CALLBACK_MEMBER(interrupt_gen);
5559   required_device<cpu_device> m_maincpu;
60
61protected:
62   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5663};
5764
5865
r22843r22844
205212   DEVCB_NULL      /* IRQB */
206213};
207214
208TIMER_CALLBACK_MEMBER(tugboat_state::interrupt_gen)
215void tugboat_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
209216{
210   m_maincpu->set_input_line(0, HOLD_LINE);
211   machine().scheduler().timer_set(machine().primary_screen->frame_period(), timer_expired_delegate(FUNC(tugboat_state::interrupt_gen),this));
217   switch (id)
218   {
219   case TIMER_INTERRUPT:
220      m_maincpu->set_input_line(0, HOLD_LINE);
221      timer_set(machine().primary_screen->frame_period(), TIMER_INTERRUPT);
222      break;
223   default:
224      assert_always(FALSE, "Unknown id in tugboat_state::device_timer");
225   }
212226}
213227
214228void tugboat_state::machine_reset()
215229{
216   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(30*8+4), timer_expired_delegate(FUNC(tugboat_state::interrupt_gen),this));
230   timer_set(machine().primary_screen->time_until_pos(30*8+4), TIMER_INTERRUPT);
217231}
218232
219233
trunk/src/mame/includes/asuka.h
r22843r22844
99class asuka_state : public driver_device
1010{
1111public:
12   enum
13   {
14      TIMER_CADASH_INTERRUPT5
15   };
16
1217   asuka_state(const machine_config &mconfig, device_type type, const char *tag)
1318      : driver_device(mconfig, type, tag),
1419      m_cadash_shared_ram(*this, "sharedram"),
r22843r22844
5964   UINT32 screen_update_asuka(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6065   void screen_eof_asuka(screen_device &screen, bool state);
6166   INTERRUPT_GEN_MEMBER(cadash_interrupt);
62   TIMER_CALLBACK_MEMBER(cadash_interrupt5);
6367
6468   /*----------- defined in machine/bonzeadv.c -----------*/
6569   void WriteLevelData();
r22843r22844
7276   DECLARE_WRITE16_MEMBER( bonzeadv_cchip_ram_w );
7377   DECLARE_WRITE_LINE_MEMBER(irqhandler);
7478   DECLARE_WRITE_LINE_MEMBER(asuka_msm5205_vck);
79
80protected:
81   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
7582};
trunk/src/mame/includes/groundfx.h
r22843r22844
1111class groundfx_state : public driver_device
1212{
1313public:
14   enum
15   {
16      TIMER_GROUNDFX_INTERRUPT5
17   };
18
1419   groundfx_state(const machine_config &mconfig, device_type type, const char *tag)
1520      : driver_device(mconfig, type, tag),
1621      m_ram(*this,"ram"),
r22843r22844
4045   virtual void video_start();
4146   UINT32 screen_update_groundfx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4247   INTERRUPT_GEN_MEMBER(groundfx_interrupt);
43   TIMER_CALLBACK_MEMBER(groundfx_interrupt5);
4448   void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int do_hack,int x_offs,int y_offs);
4549   required_device<cpu_device> m_maincpu;
50
51protected:
52   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
4653};
trunk/src/mame/includes/vendetta.h
r22843r22844
88class vendetta_state : public driver_device
99{
1010public:
11   enum
12   {
13      TIMER_Z80_NMI
14   };
15
1116   vendetta_state(const machine_config &mconfig, device_type type, const char *tag)
1217      : driver_device(mconfig, type, tag),
1318      m_maincpu(*this, "maincpu"),
r22843r22844
5358   virtual void machine_reset();
5459   UINT32 screen_update_vendetta(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5560   INTERRUPT_GEN_MEMBER(vendetta_irq);
56   TIMER_CALLBACK_MEMBER(z80_nmi_callback);
5761   void vendetta_video_banking( int select );
62
63protected:
64   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5865};
5966
6067/*----------- defined in video/vendetta.c -----------*/
trunk/src/mame/includes/taito_f3.h
r22843r22844
4545class taito_f3_state : public driver_device
4646{
4747public:
48   enum
49   {
50      TIMER_F3_INTERRUPT3
51   };
52
4853   taito_f3_state(const machine_config &mconfig, device_type type, const char *tag)
4954      : driver_device(mconfig, type, tag),
5055      m_f3_ram(*this,"f3_ram") ,
r22843r22844
278283   UINT32 screen_update_f3(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
279284   void screen_eof_f3(screen_device &screen, bool state);
280285   INTERRUPT_GEN_MEMBER(f3_interrupt2);
281   TIMER_CALLBACK_MEMBER(f3_interrupt3);
282286   required_device<cpu_device> m_maincpu;
283287   optional_device<cpu_device> m_audiocpu;
284288   optional_device<okim6295_device> m_oki;
289
290protected:
291   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
285292};
trunk/src/mame/includes/fuukifg3.h
r22843r22844
1212class fuuki32_state : public driver_device
1313{
1414public:
15   enum
16   {
17      TIMER_LEVEL_1_INTERRUPT,
18      TIMER_VBLANK_INTERRUPT,
19      TIMER_RASTER_INTERRUPT
20   };
21
1522   fuuki32_state(const machine_config &mconfig, device_type type, const char *tag)
1623      : driver_device(mconfig, type, tag),
1724      m_vram(*this, "vram"),
r22843r22844
7481   void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
7582   void fuuki32_draw_layer( bitmap_ind16 &bitmap, const rectangle &cliprect, int i, int flag, int pri );
7683   DECLARE_WRITE_LINE_MEMBER(irqhandler);
84
85protected:
86   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
7787};
trunk/src/mame/includes/dec8.h
r22843r22844
44class dec8_state : public driver_device
55{
66public:
7   enum
8   {
9      TIMER_DEC8_I8751
10   };
11
712   dec8_state(const machine_config &mconfig, device_type type, const char *tag)
813      : driver_device(mconfig, type, tag),
914      m_maincpu(*this, "maincpu"),
r22843r22844
140145   void screen_eof_dec8(screen_device &screen, bool state);
141146   INTERRUPT_GEN_MEMBER(gondo_interrupt);
142147   INTERRUPT_GEN_MEMBER(oscar_interrupt);
143   TIMER_CALLBACK_MEMBER(dec8_i8751_timer_callback);
144148   void srdarwin_draw_sprites(  bitmap_ind16 &bitmap, const rectangle &cliprect, int pri );
145149   DECLARE_WRITE_LINE_MEMBER(irqhandler);
146150   DECLARE_WRITE_LINE_MEMBER(csilver_adpcm_int);
151
152protected:
153   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
147154};
trunk/src/mame/includes/taito_z.h
r22843r22844
1212class taitoz_state : public driver_device
1313{
1414public:
15   enum
16   {
17      TIMER_TAITOZ_INTERRUPT6,
18      TIMER_TAITOZ_CPUB_INTERRUPT5
19   };
20
1521   taitoz_state(const machine_config &mconfig, device_type type, const char *tag)
1622      : driver_device(mconfig, type, tag),
1723      m_spriteram(*this, "spriteram"),
r22843r22844
96102   UINT32 screen_update_dblaxle(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
97103   UINT32 screen_update_racingb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
98104   INTERRUPT_GEN_MEMBER(sci_interrupt);
99   TIMER_CALLBACK_MEMBER(taitoz_interrupt6);
100   TIMER_CALLBACK_MEMBER(taitoz_cpub_interrupt5);
101105   void taitoz_postload();
102106   void contcirc_draw_sprites_16x8( bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs );
103107   void chasehq_draw_sprites_16x16( bitmap_ind16 &bitmap, const rectangle &cliprect, int y_offs );
r22843r22844
109113   void reset_sound_region(  );
110114   DECLARE_WRITE_LINE_MEMBER(irqhandler);
111115   DECLARE_WRITE_LINE_MEMBER(irqhandlerb);
116
117protected:
118   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
112119};
trunk/src/mame/includes/undrfire.h
r22843r22844
1212class undrfire_state : public driver_device
1313{
1414public:
15   enum
16   {
17      TIMER_INTERRUPT5
18   };
19
1520   undrfire_state(const machine_config &mconfig, device_type type, const char *tag)
1621      : driver_device(mconfig, type, tag),
1722         m_ram(*this, "ram"),
r22843r22844
5055   UINT32 screen_update_undrfire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5156   UINT32 screen_update_cbombers(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5257   INTERRUPT_GEN_MEMBER(undrfire_interrupt);
53   TIMER_CALLBACK_MEMBER(interrupt5);
5458   void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs);
5559   void draw_sprites_cbombers(bitmap_ind16 &bitmap,const rectangle &cliprect,const int *primasks,int x_offs,int y_offs);
5660   required_device<cpu_device> m_maincpu;
5761   optional_device<cpu_device> m_subcpu;
5862   required_device<eeprom_device> m_eeprom;
63
64protected:
65   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5966};
trunk/src/mame/includes/metro.h
r22843r22844
1212class metro_state : public driver_device
1313{
1414public:
15   enum
16   {
17      TIMER_KARATOUR_IRQ,
18      TIMER_MOUJA_IRQ,
19      TIMER_METRO_BLIT_DONE
20   };
21
1522   metro_state(const machine_config &mconfig, device_type type, const char *tag)
1623      : driver_device(mconfig, type, tag),
1724      m_maincpu(*this, "maincpu"),
r22843r22844
192199               int sx, int sy, int wx, int wy, int big, UINT16 *tilemapram, int layer );
193200   DECLARE_WRITE_LINE_MEMBER(blzntrnd_irqhandler);
194201   DECLARE_WRITE_LINE_MEMBER(ymf278b_interrupt);
202
203protected:
204   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
195205};
196206
197207
trunk/src/mame/includes/rollerg.h
r22843r22844
88class rollerg_state : public driver_device
99{
1010public:
11   enum
12   {
13      TIMER_NMI
14   };
15
1116   rollerg_state(const machine_config &mconfig, device_type type, const char *tag)
1217      : driver_device(mconfig, type, tag),
1318      m_maincpu(*this, "maincpu"),
r22843r22844
4348   virtual void machine_reset();
4449   virtual void video_start();
4550   UINT32 screen_update_rollerg(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
46   TIMER_CALLBACK_MEMBER(nmi_callback);
51
52protected:
53   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
4754};
4855
4956/*----------- defined in video/rollerg.c -----------*/
trunk/src/mame/includes/tehkanwc.h
r22843r22844
33class tehkanwc_state : public driver_device
44{
55public:
6   enum
7   {
8      TIMER_RESET
9   };
10
611   tehkanwc_state(const machine_config &mconfig, device_type type, const char *tag)
712      : driver_device(mconfig, type, tag),
813      m_videoram(*this, "videoram"),
r22843r22844
5358   TILE_GET_INFO_MEMBER(get_fg_tile_info);
5459   virtual void video_start();
5560   UINT32 screen_update_tehkanwc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
56   TIMER_CALLBACK_MEMBER(reset_callback);
5761   void gridiron_draw_led(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 led,int player);
5862   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
5963   DECLARE_WRITE_LINE_MEMBER(tehkanwc_adpcm_int);
r22843r22844
6165   required_device<cpu_device> m_audiocpu;
6266   required_device<cpu_device> m_subcpu;
6367   required_device<msm5205_device> m_msm;
68
69protected:
70   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
6471};
trunk/src/mame/includes/skullxbo.h
r22843r22844
99class skullxbo_state : public atarigen_state
1010{
1111public:
12   enum
13   {
14      TIMER_IRQ_GEN
15   };
16
1217   skullxbo_state(const machine_config &mconfig, device_type type, const char *tag)
1318      : atarigen_state(mconfig, type, tag) { }
1419   virtual void update_interrupts();
r22843r22844
2328   DECLARE_MACHINE_RESET(skullxbo);
2429   DECLARE_VIDEO_START(skullxbo);
2530   UINT32 screen_update_skullxbo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
26   TIMER_CALLBACK_MEMBER(irq_gen);
2731   void skullxbo_scanline_update(int scanline);
2832   DECLARE_WRITE16_MEMBER( skullxbo_playfieldlatch_w );
2933   DECLARE_WRITE16_MEMBER( skullxbo_xscroll_w );
3034   DECLARE_WRITE16_MEMBER( skullxbo_yscroll_w );
3135   DECLARE_WRITE16_MEMBER( skullxbo_mobmsb_w );
36
37protected:
38   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
3239};
trunk/src/mame/includes/sprint4.h
r22843r22844
11class sprint4_state : public driver_device
22{
33public:
4   enum
5   {
6      TIMER_NMI
7   };
8
49   sprint4_state(const machine_config &mconfig, device_type type, const char *tag)
510      : driver_device(mconfig, type, tag),
611      m_videoram(*this, "videoram"),
r22843r22844
4550   TIMER_CALLBACK_MEMBER(nmi_callback);
4651   required_device<cpu_device> m_maincpu;
4752   required_device<discrete_device> m_discrete;
53
54protected:
55   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
4856};
trunk/src/mame/includes/othunder.h
r22843r22844
2323class othunder_state : public driver_device
2424{
2525public:
26   enum
27   {
28      TIMER_AD_INTERRUPT
29   };
30
2631   othunder_state(const machine_config &mconfig, device_type type, const char *tag)
2732      : driver_device(mconfig, type, tag),
2833      m_spriteram(*this,"spriteram"),
r22843r22844
8085   virtual void video_start();
8186   UINT32 screen_update_othunder(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8287   INTERRUPT_GEN_MEMBER(vblank_interrupt);
83   TIMER_CALLBACK_MEMBER(ad_interrupt);
8488   void reset_sound_region();
8589   void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, const int *primasks, int y_offs );
8690   void update_irq(  );
8791   DECLARE_WRITE_LINE_MEMBER(irqhandler);
92
93protected:
94   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
8895};
trunk/src/mame/includes/slapshot.h
r22843r22844
2121class slapshot_state : public driver_device
2222{
2323public:
24   enum
25   {
26      TIMER_SLAPSHOT_INTERRUPT6
27   };
28
2429   slapshot_state(const machine_config &mconfig, device_type type, const char *tag)
2530      : driver_device(mconfig, type, tag),
2631      m_color_ram(*this,"color_ram"),
r22843r22844
7782   UINT32 screen_update_slapshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7883   void screen_eof_taito_no_buffer(screen_device &screen, bool state);
7984   INTERRUPT_GEN_MEMBER(slapshot_interrupt);
80   TIMER_CALLBACK_MEMBER(slapshot_interrupt6);
8185   void reset_sound_region();
8286   void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int *primasks, int y_offset );
8387   void taito_handle_sprite_buffering(  );
8488   void taito_update_sprites_active_area(  );
8589   DECLARE_WRITE_LINE_MEMBER(irqhandler);
90
91protected:
92   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
8693};

Previous 199869 Revisions Next


© 1997-2024 The MAME Team