Previous 199869 Revisions Next

r22837 Wednesday 15th May, 2013 at 18:45:55 UTC by Andrew Gardner
Had time for a few more. (nw)
[src/mame/drivers]fuukifg2.c gaplus.c parodius.c tickee.c ultratnk.c videopin.c wolfpack.c zr107.c
[src/mame/includes]fuukifg2.h gaplus.h parodius.h ultratnk.h videopin.h wolfpack.h

trunk/src/mame/drivers/videopin.c
r22836r22837
4343}
4444
4545
46void videopin_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
47{
48   switch (id)
49   {
50   case TIMER_INTERRUPT:
51      interrupt_callback(ptr, param);
52      break;
53   default:
54      assert_always(FALSE, "Unknown id in videopin_state::device_timer");
55   }
56}
57
58
4659TIMER_CALLBACK_MEMBER(videopin_state::interrupt_callback)
4760{
4861   int scanline = param;
r22836r22837
5669   if (scanline >= 263)
5770      scanline = 32;
5871
59   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(videopin_state::interrupt_callback),this), scanline);
72   timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_INTERRUPT, scanline);
6073}
6174
6275
6376void videopin_state::machine_reset()
6477{
65   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(32), timer_expired_delegate(FUNC(videopin_state::interrupt_callback),this), 32);
78   timer_set(machine().primary_screen->time_until_pos(32), TIMER_INTERRUPT, 32);
6679
6780   /* both output latches are cleared on reset */
6881
trunk/src/mame/drivers/ultratnk.c
r22836r22837
4141}
4242
4343
44void ultratnk_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 ultratnk_state::device_timer");
53   }
54}
55
56
4457TIMER_CALLBACK_MEMBER(ultratnk_state::nmi_callback)
4558{
4659   int scanline = param + 64;
r22836r22837
5568   if (ioport("IN0")->read() & 0x40)
5669      m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
5770
58   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(ultratnk_state::nmi_callback),this), scanline);
71   timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_NMI, scanline);
5972}
6073
6174
6275void ultratnk_state::machine_reset()
6376{
64   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(32), timer_expired_delegate(FUNC(ultratnk_state::nmi_callback),this), 32);
77   timer_set(machine().primary_screen->time_until_pos(32), TIMER_NMI, 32);
6578}
6679
6780
trunk/src/mame/drivers/fuukifg2.c
r22836r22837
406406            also used for water effects and titlescreen linescroll on gogomile
407407*/
408408
409TIMER_CALLBACK_MEMBER(fuuki16_state::level_1_interrupt_callback)
409void fuuki16_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
410410{
411   m_maincpu->set_input_line(1, HOLD_LINE);
412   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(248), timer_expired_delegate(FUNC(fuuki16_state::level_1_interrupt_callback),this));
411   switch (id)
412   {
413   case TIMER_LEVEL_1_INTERRUPT:
414      m_maincpu->set_input_line(1, HOLD_LINE);
415      timer_set(machine().primary_screen->time_until_pos(248), TIMER_LEVEL_1_INTERRUPT);
416      break;
417   case TIMER_VBLANK_INTERRUPT:
418      m_maincpu->set_input_line(3, HOLD_LINE);    // VBlank IRQ
419      timer_set(machine().primary_screen->time_until_vblank_start(), TIMER_VBLANK_INTERRUPT);
420      break;
421   case TIMER_RASTER_INTERRUPT:
422      m_maincpu->set_input_line(5, HOLD_LINE);    // Raster Line IRQ
423      machine().primary_screen->update_partial(machine().primary_screen->vpos());
424      m_raster_interrupt_timer->adjust(machine().primary_screen->frame_period());
425      break;
426   default:
427      assert_always(FALSE, "Unknown id in fuuki16_state::device_timer");
428   }
413429}
414430
415431
416TIMER_CALLBACK_MEMBER(fuuki16_state::vblank_interrupt_callback)
417{
418   m_maincpu->set_input_line(3, HOLD_LINE);    // VBlank IRQ
419   machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_start(), timer_expired_delegate(FUNC(fuuki16_state::vblank_interrupt_callback),this));
420}
421
422
423TIMER_CALLBACK_MEMBER(fuuki16_state::raster_interrupt_callback)
424{
425   m_maincpu->set_input_line(5, HOLD_LINE);    // Raster Line IRQ
426   machine().primary_screen->update_partial(machine().primary_screen->vpos());
427   m_raster_interrupt_timer->adjust(machine().primary_screen->frame_period());
428}
429
430
431432void fuuki16_state::machine_start()
432433{
433434   UINT8 *ROM = memregion("audiocpu")->base();
434435
435436   membank("bank1")->configure_entries(0, 3, &ROM[0x10000], 0x8000);
436437
437
438   m_raster_interrupt_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fuuki16_state::raster_interrupt_callback),this));
438   m_raster_interrupt_timer = timer_alloc(TIMER_RASTER_INTERRUPT);
439439}
440440
441441
r22836r22837
443443{
444444   const rectangle &visarea = machine().primary_screen->visible_area();
445445
446   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(248), timer_expired_delegate(FUNC(fuuki16_state::level_1_interrupt_callback),this));
447   machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_start(), timer_expired_delegate(FUNC(fuuki16_state::vblank_interrupt_callback),this));
446   timer_set(machine().primary_screen->time_until_pos(248), TIMER_LEVEL_1_INTERRUPT);
447   timer_set(machine().primary_screen->time_until_vblank_start(), TIMER_LEVEL_1_INTERRUPT);
448448   m_raster_interrupt_timer->adjust(machine().primary_screen->time_until_pos(0, visarea.max_x + 1));
449449}
450450
trunk/src/mame/drivers/tickee.c
r22836r22837
3131class tickee_state : public driver_device
3232{
3333public:
34   enum
35   {
36      TIMER_TRIGGER_GUN_INTERRUPT,
37      TIMER_CLEAR_GUN_INTERRUPT,
38      TIMER_SETUP_GUN_INTERRUPTS
39   };
40
3441   tickee_state(const machine_config &mconfig, device_type type, const char *tag)
3542      : driver_device(mconfig, type, tag),
3643      m_tlc34076(*this, "tlc34076"),
r22836r22837
6572   TIMER_CALLBACK_MEMBER(setup_gun_interrupts);
6673   required_device<cpu_device> m_maincpu;
6774   optional_device<okim6295_device> m_oki;
75
76protected:
77   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
6878};
6979
7080
r22836r22837
95105 *
96106 *************************************/
97107
108void tickee_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
109{
110   switch (id)
111   {
112   case TIMER_TRIGGER_GUN_INTERRUPT:
113      trigger_gun_interrupt(ptr, param);
114      break;
115   case TIMER_CLEAR_GUN_INTERRUPT:
116      clear_gun_interrupt(ptr, param);
117      break;
118   case TIMER_SETUP_GUN_INTERRUPTS:
119      setup_gun_interrupts(ptr, param);
120      break;
121   default:
122      assert_always(FALSE, "Unknown id in tickee_state::device_timer");
123   }
124}
125
126
98127TIMER_CALLBACK_MEMBER(tickee_state::trigger_gun_interrupt)
99128{
100129   int which = param & 1;
r22836r22837
129158
130159   /* generate interrupts for player 1's gun */
131160   get_crosshair_xy(machine(), 0, &beamx, &beamy);
132   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(beamy + m_beamyadd, beamx + m_beamxadd), timer_expired_delegate(FUNC(tickee_state::trigger_gun_interrupt),this), 0);
133   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(beamy + m_beamyadd + 1, beamx + m_beamxadd), timer_expired_delegate(FUNC(tickee_state::clear_gun_interrupt),this), 0);
161   timer_set(machine().primary_screen->time_until_pos(beamy + m_beamyadd, beamx + m_beamxadd), TIMER_TRIGGER_GUN_INTERRUPT, 0);
162   timer_set(machine().primary_screen->time_until_pos(beamy + m_beamyadd + 1, beamx + m_beamxadd), TIMER_CLEAR_GUN_INTERRUPT, 0);
134163
135164   /* generate interrupts for player 2's gun */
136165   get_crosshair_xy(machine(), 1, &beamx, &beamy);
137   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(beamy + m_beamyadd, beamx + m_beamxadd), timer_expired_delegate(FUNC(tickee_state::trigger_gun_interrupt),this), 1);
138   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(beamy + m_beamyadd + 1, beamx + m_beamxadd), timer_expired_delegate(FUNC(tickee_state::clear_gun_interrupt),this), 1);
166   timer_set(machine().primary_screen->time_until_pos(beamy + m_beamyadd, beamx + m_beamxadd), TIMER_TRIGGER_GUN_INTERRUPT, 1);
167   timer_set(machine().primary_screen->time_until_pos(beamy + m_beamyadd + 1, beamx + m_beamxadd), TIMER_CLEAR_GUN_INTERRUPT, 1);
139168}
140169
141170
r22836r22837
149178VIDEO_START_MEMBER(tickee_state,tickee)
150179{
151180   /* start a timer going on the first scanline of every frame */
152   m_setup_gun_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tickee_state::setup_gun_interrupts),this));
181   m_setup_gun_timer = timer_alloc(TIMER_SETUP_GUN_INTERRUPTS);
153182   m_setup_gun_timer->adjust(machine().primary_screen->time_until_pos(0));
154183}
155184
trunk/src/mame/drivers/parodius.c
r22836r22837
113113}
114114#endif
115115
116TIMER_CALLBACK_MEMBER(parodius_state::nmi_callback)
116void parodius_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
117117{
118   m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
118   switch (id)
119   {
120   case TIMER_NMI:
121      m_audiocpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
122      break;
123   default:
124      assert_always(FALSE, "Unknown id in parodius_state::device_timer");
125   }
119126}
120127
121128WRITE8_MEMBER(parodius_state::sound_arm_nmi_w)
122129{
123130   m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
124   machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(parodius_state::nmi_callback),this));  /* kludge until the K053260 is emulated correctly */
131   timer_set(attotime::from_usec(50), TIMER_NMI);  /* kludge until the K053260 is emulated correctly */
125132}
126133
127134/********************************************/
trunk/src/mame/drivers/zr107.c
r22836r22837
180180class zr107_state : public driver_device
181181{
182182public:
183   enum
184   {
185      TIMER_IRQ_OFF
186   };
187
183188   zr107_state(const machine_config &mconfig, device_type type, const char *tag)
184189      : driver_device(mconfig, type, tag),
185190      m_workram(*this, "workram"),
r22836r22837
214219   UINT32 screen_update_zr107(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
215220   UINT32 screen_update_jetwave(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
216221   INTERRUPT_GEN_MEMBER(zr107_vblank);
217   TIMER_CALLBACK_MEMBER(irq_off);
218222   required_device<cpu_device> m_maincpu;
219223   required_device<cpu_device> m_audiocpu;
220224   required_device<cpu_device> m_dsp;
221225   optional_device<k001604_device> m_k001604;
222226   optional_device<k056832_device> m_k056832;
227
228protected:
229   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
223230};
224231
225232
r22836r22837
420427   /* set conservative DRC options */
421428   ppcdrc_set_options(m_maincpu, PPCDRC_COMPATIBLE_OPTIONS);
422429
423   m_sound_irq_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(zr107_state::irq_off),this));
430   m_sound_irq_timer = timer_alloc(TIMER_IRQ_OFF);
424431
425432   /* configure fast RAM regions for DRC */
426433   ppcdrc_add_fastram(m_maincpu, 0x00000000, 0x000fffff, FALSE, m_workram);
r22836r22837
688695};
689696
690697
691TIMER_CALLBACK_MEMBER(zr107_state::irq_off)
698void zr107_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
692699{
693   m_audiocpu->set_input_line(param, CLEAR_LINE);
700   switch (id)
701   {
702   case TIMER_IRQ_OFF:
703      m_audiocpu->set_input_line(param, CLEAR_LINE);
704      break;
705   default:
706      assert_always(FALSE, "Unknown id in zr107_state::device_timer");
707   }
694708}
695709
696710static void sound_irq_callback( running_machine &machine, int irq )
r22836r22837
699713   int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2;
700714
701715   state->m_audiocpu->set_input_line(line, ASSERT_LINE);
702   machine.scheduler().timer_set(attotime::from_usec(5), timer_expired_delegate(FUNC(zr107_state::irq_off),state), line);
716   state->timer_set(attotime::from_usec(5), zr107_state::TIMER_IRQ_OFF, line);
703717}
704718
705719static const k056800_interface zr107_k056800_interface =
trunk/src/mame/drivers/wolfpack.c
r22836r22837
99#include "sound/s14001a.h"
1010#include "includes/wolfpack.h"
1111
12
13void wolfpack_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
14{
15   switch (id)
16   {
17   case TIMER_PERIODIC:
18      periodic_callback(ptr, param);
19      break;
20   default:
21      assert_always(FALSE, "Unknown id in wolfpack_state::device_timer");
22   }
23}
24
25
1226TIMER_CALLBACK_MEMBER(wolfpack_state::periodic_callback)
1327{
1428   int scanline = param;
r22836r22837
2034   if (scanline >= 262)
2135      scanline = 0;
2236
23   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(scanline), timer_expired_delegate(FUNC(wolfpack_state::periodic_callback),this), scanline);
37   timer_set(machine().primary_screen->time_until_pos(scanline), TIMER_PERIODIC, scanline);
2438}
2539
2640
2741void wolfpack_state::machine_reset()
2842{
29   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(wolfpack_state::periodic_callback),this));
43   timer_set(machine().primary_screen->time_until_pos(0), TIMER_PERIODIC);
3044}
3145
3246
trunk/src/mame/drivers/gaplus.c
r22836r22837
234234   m_subcpu->set_input_line(0, CLEAR_LINE);
235235}
236236
237void gaplus_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
238{
239   switch (id)
240   {
241   case TIMER_NAMCOIO_RUN:
242      namcoio_run(ptr, param);
243      break;
244   default:
245      assert_always(FALSE, "Unknown id in gaplus_state::device_timer");
246   }
247}
248
237249TIMER_CALLBACK_MEMBER(gaplus_state::namcoio_run)
238250{
239251   device_t *io58xx = machine().device("58xx");
r22836r22837
259271      m_maincpu->set_input_line(0, ASSERT_LINE);
260272
261273   if (!namcoio_read_reset_line(io58xx))       /* give the cpu a tiny bit of time to write the command before processing it */
262      machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(gaplus_state::namcoio_run),this));
274      timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN);
263275
264276   if (!namcoio_read_reset_line(io56xx))       /* give the cpu a tiny bit of time to write the command before processing it */
265      machine().scheduler().timer_set(attotime::from_usec(50), timer_expired_delegate(FUNC(gaplus_state::namcoio_run),this), 1);
277      timer_set(attotime::from_usec(50), TIMER_NAMCOIO_RUN, 1);
266278}
267279
268280INTERRUPT_GEN_MEMBER(gaplus_state::gaplus_vblank_sub_irq)
trunk/src/mame/includes/gaplus.h
r22836r22837
1010class gaplus_state : public driver_device
1111{
1212public:
13   enum
14   {
15      TIMER_NAMCOIO_RUN
16   };
17
1318   gaplus_state(const machine_config &mconfig, device_type type, const char *tag)
1419      : driver_device(mconfig, type, tag),
1520         m_customio_3(*this,"customio_3"),
r22836r22837
6368   required_device<cpu_device> m_subcpu;
6469   required_device<cpu_device> m_subcpu2;
6570   required_device<samples_device> m_samples;
71
72protected:
73   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
6674};
trunk/src/mame/includes/videopin.h
r22836r22837
1818class videopin_state : public driver_device
1919{
2020public:
21   enum
22   {
23      TIMER_INTERRUPT
24   };
25
2126   videopin_state(const machine_config &mconfig, device_type type, const char *tag)
2227      : driver_device(mconfig, type, tag),
2328      m_video_ram(*this, "video_ram"),
r22836r22837
4954   double calc_plunger_pos();
5055   required_device<cpu_device> m_maincpu;
5156   required_device<discrete_device> m_discrete;
57
58protected:
59   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5260};
5361
5462/*----------- defined in audio/videopin.c -----------*/
trunk/src/mame/includes/ultratnk.h
r22836r22837
99class ultratnk_state : public driver_device
1010{
1111public:
12   enum
13   {
14      TIMER_NMI
15   };
16
1217   ultratnk_state(const machine_config &mconfig, device_type type, const char *tag)
1318      : driver_device(mconfig, type, tag),
1419      m_videoram(*this, "videoram"),
r22836r22837
4752   TIMER_CALLBACK_MEMBER(nmi_callback);
4853   required_device<cpu_device> m_maincpu;
4954   required_device<discrete_device> m_discrete;
55
56protected:
57   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5058};
trunk/src/mame/includes/parodius.h
r22836r22837
88class parodius_state : public driver_device
99{
1010public:
11   enum
12   {
13      TIMER_NMI
14   };
15
1116   parodius_state(const machine_config &mconfig, device_type type, const char *tag)
1217      : driver_device(mconfig, type, tag),
1318      m_ram(*this, "ram"),
r22836r22837
5156   virtual void machine_reset();
5257   UINT32 screen_update_parodius(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5358   INTERRUPT_GEN_MEMBER(parodius_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/parodius.c -----------*/
trunk/src/mame/includes/fuukifg2.h
r22836r22837
33class fuuki16_state : public driver_device
44{
55public:
6   enum
7   {
8      TIMER_LEVEL_1_INTERRUPT,
9      TIMER_VBLANK_INTERRUPT,
10      TIMER_RASTER_INTERRUPT
11   };
12
613   fuuki16_state(const machine_config &mconfig, device_type type, const char *tag)
714      : driver_device(mconfig, type, tag),
815      m_vram(*this, "vram"),
r22836r22837
4754   virtual void machine_reset();
4855   virtual void video_start();
4956   UINT32 screen_update_fuuki16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
50   TIMER_CALLBACK_MEMBER(level_1_interrupt_callback);
51   TIMER_CALLBACK_MEMBER(vblank_interrupt_callback);
52   TIMER_CALLBACK_MEMBER(raster_interrupt_callback);
5357   inline void get_tile_info(tile_data &tileinfo, tilemap_memory_index tile_index, int _N_);
5458   inline void fuuki16_vram_w(offs_t offset, UINT16 data, UINT16 mem_mask, int _N_);
5559   void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect );
5660   void fuuki16_draw_layer( bitmap_ind16 &bitmap, const rectangle &cliprect, int i, int flag, int pri );
5761   DECLARE_WRITE_LINE_MEMBER(soundirq);
5862   required_device<okim6295_device> m_oki;
63
64protected:
65   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5966};
trunk/src/mame/includes/wolfpack.h
r22836r22837
11class wolfpack_state : public driver_device
22{
33public:
4   enum
5   {
6      TIMER_PERIODIC
7   };
8
49   wolfpack_state(const machine_config &mconfig, device_type type, const char *tag)
510      : driver_device(mconfig, type, tag),
611      m_alpha_num_ram(*this, "alpha_num_ram"),
r22836r22837
6368   void draw_pt(bitmap_ind16 &bitmap, const rectangle &cliprect);
6469   void draw_water(colortable_t *colortable, bitmap_ind16 &bitmap, const rectangle &cliprect);
6570   required_device<cpu_device> m_maincpu;
71
72protected:
73   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
6674};

Previous 199869 Revisions Next


© 1997-2024 The MAME Team