nb1413m3_device: anonymous timer isn't anonymous anymore (nw)

This commit is contained in:
Osso13 2015-01-15 18:03:43 +01:00
parent 45f6401363
commit 7d32bea42e
2 changed files with 23 additions and 15 deletions

View File

@ -129,6 +129,11 @@ public:
// (static) configuration helpers
static void set_type(device_t &device, int type) { downcast<nb1413m3_device &>(device).m_nb1413m3_type = type; }
enum
{
TIMER_CB
};
DECLARE_WRITE8_MEMBER( nmi_clock_w );
DECLARE_READ8_MEMBER( sndrom_r );
@ -161,10 +166,10 @@ public:
protected:
// device-level overrides
virtual void device_config_complete();
virtual void device_start();
virtual void device_reset();
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
private:
int m_74ls193_counter;
@ -176,9 +181,8 @@ private:
int m_gfxradr_h;
int m_gfxrombank;
int m_outcoin_enable;
emu_timer *m_timer_cb;
TIMER_CALLBACK_MEMBER( timer_callback );
};
/* used in: hyhoo.c, niyanpai.c, pastelg.c, nbmj8688.c, nbmj8891.c, nbmj8991.c, nbmj9195.c*/

View File

@ -42,15 +42,6 @@ nb1413m3_device::nb1413m3_device(const machine_config &mconfig, const char *tag,
{
}
//-------------------------------------------------
// device_config_complete - perform any
// operations now that the configuration is
// complete
//-------------------------------------------------
void nb1413m3_device::device_config_complete()
{
}
//-------------------------------------------------
// device_start - device-specific startup
@ -58,7 +49,8 @@ void nb1413m3_device::device_config_complete()
void nb1413m3_device::device_start()
{
machine().scheduler().synchronize(timer_expired_delegate(FUNC(nb1413m3_device::timer_callback), this));
m_timer_cb = timer_alloc(TIMER_CB);
synchronize(TIMER_CB);
save_item(NAME(m_nb1413m3_type));
save_item(NAME(m_sndrombank1));
@ -105,10 +97,22 @@ void nb1413m3_device::device_reset()
DEVICE HANDLERS
*****************************************************************************/
void nb1413m3_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
{
switch (id)
{
case TIMER_CB:
timer_callback(ptr, param);
break;
default:
assert_always(FALSE, "Unknown id in nb1413m3_device::device_timer");
}
}
/* TODO: is all of this actually programmable? */
TIMER_CALLBACK_MEMBER( nb1413m3_device::timer_callback )
{
machine().scheduler().timer_set(attotime::from_hz(NB1413M3_TIMER_BASE) * 256, timer_expired_delegate(FUNC(nb1413m3_device::timer_callback), this));
m_timer_cb->adjust(attotime::from_hz(NB1413M3_TIMER_BASE) * 256);
m_74ls193_counter++;
m_74ls193_counter &= 0x0f;