Previous 199869 Revisions Next

r34403 Thursday 15th January, 2015 at 17:03:43 UTC by Osso
nb1413m3_device: anonymous timer isn't anonymous anymore (nw)
[src/mame/includes]nb1413m3.h
[src/mame/machine]nb1413m3.c

trunk/src/mame/includes/nb1413m3.h
r242914r242915
129129
130130   // (static) configuration helpers
131131   static void set_type(device_t &device, int type) { downcast<nb1413m3_device &>(device).m_nb1413m3_type = type; }
132   
133   enum
134   {
135      TIMER_CB
136   };
132137
133138   DECLARE_WRITE8_MEMBER( nmi_clock_w );
134139   DECLARE_READ8_MEMBER( sndrom_r );
r242914r242915
161166
162167protected:
163168   // device-level overrides
164   virtual void device_config_complete();
165169   virtual void device_start();
166170   virtual void device_reset();
167
171   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
172   
168173private:
169174
170175   int m_74ls193_counter;
r242914r242915
176181   int m_gfxradr_h;
177182   int m_gfxrombank;
178183   int m_outcoin_enable;
179
184   emu_timer *m_timer_cb;
180185   TIMER_CALLBACK_MEMBER( timer_callback );
181
182186};
183187
184188/* used in: hyhoo.c, niyanpai.c, pastelg.c, nbmj8688.c, nbmj8891.c, nbmj8991.c, nbmj9195.c*/
trunk/src/mame/machine/nb1413m3.c
r242914r242915
4242{
4343}
4444
45//-------------------------------------------------
46//  device_config_complete - perform any
47//  operations now that the configuration is
48//  complete
49//-------------------------------------------------
5045
51void nb1413m3_device::device_config_complete()
52{
53}
54
5546//-------------------------------------------------
5647//  device_start - device-specific startup
5748//-------------------------------------------------
5849
5950void nb1413m3_device::device_start()
6051{
61   machine().scheduler().synchronize(timer_expired_delegate(FUNC(nb1413m3_device::timer_callback), this));
52   m_timer_cb = timer_alloc(TIMER_CB);
53   synchronize(TIMER_CB);
6254
6355   save_item(NAME(m_nb1413m3_type));
6456   save_item(NAME(m_sndrombank1));
r242914r242915
10597    DEVICE HANDLERS
10698*****************************************************************************/
10799
100void nb1413m3_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
101{
102   switch (id)
103   {
104      case TIMER_CB:
105         timer_callback(ptr, param);
106         break;
107      default:
108         assert_always(FALSE, "Unknown id in nb1413m3_device::device_timer");
109   }
110}
111
108112/* TODO: is all of this actually programmable? */
109113TIMER_CALLBACK_MEMBER( nb1413m3_device::timer_callback )
110114{
111   machine().scheduler().timer_set(attotime::from_hz(NB1413M3_TIMER_BASE) * 256, timer_expired_delegate(FUNC(nb1413m3_device::timer_callback), this));
115   m_timer_cb->adjust(attotime::from_hz(NB1413M3_TIMER_BASE) * 256);
112116
113117   m_74ls193_counter++;
114118   m_74ls193_counter &= 0x0f;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team