summaryrefslogtreecommitdiffstats
path: root/src/devices/machine/z80sti.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/z80sti.cpp')
-rw-r--r--src/devices/machine/z80sti.cpp46
1 files changed, 18 insertions, 28 deletions
diff --git a/src/devices/machine/z80sti.cpp b/src/devices/machine/z80sti.cpp
index f049c3d19fa..a72a370ec79 100644
--- a/src/devices/machine/z80sti.cpp
+++ b/src/devices/machine/z80sti.cpp
@@ -121,10 +121,10 @@ void z80sti_device::device_start()
m_out_tdo_cb.resolve_safe();
// create the counter timers
- m_timer[TIMER_A] = timer_alloc(TIMER_A);
- m_timer[TIMER_B] = timer_alloc(TIMER_B);
- m_timer[TIMER_C] = timer_alloc(TIMER_C);
- m_timer[TIMER_D] = timer_alloc(TIMER_D);
+ m_timer[TIMER_A] = timer_alloc(FUNC(z80sti_device::timer_count), this);
+ m_timer[TIMER_B] = timer_alloc(FUNC(z80sti_device::timer_count), this);
+ m_timer[TIMER_C] = timer_alloc(FUNC(z80sti_device::timer_count), this);
+ m_timer[TIMER_D] = timer_alloc(FUNC(z80sti_device::timer_count), this);
// create serial receive clock timer
if (m_rx_clock > 0)
@@ -176,16 +176,6 @@ void z80sti_device::device_reset()
//-------------------------------------------------
-// device_timer - handler timer events
-//-------------------------------------------------
-
-void z80sti_device::device_timer(emu_timer &timer, device_timer_id id, int param)
-{
- timer_count(id);
-}
-
-
-//-------------------------------------------------
// tra_callback -
//-------------------------------------------------
@@ -618,46 +608,46 @@ void z80sti_device::write(offs_t offset, uint8_t data)
// timer_count - timer count down
//-------------------------------------------------
-void z80sti_device::timer_count(int index)
+TIMER_CALLBACK_MEMBER(z80sti_device::timer_count)
{
- if (m_tmc[index] == 0x01)
+ if (m_tmc[param] == 0x01)
{
- //LOG("Z80STI Timer %c Expired\n", 'A' + index);
+ //LOG("Z80STI Timer %c Expired\n", 'A' + param);
// toggle timer output signal
- m_to[index] = !m_to[index];
+ m_to[param] = !m_to[param];
- switch (index)
+ switch (param)
{
case TIMER_A:
- m_out_tao_cb(m_to[index]);
+ m_out_tao_cb(m_to[param]);
break;
case TIMER_B:
- m_out_tbo_cb(m_to[index]);
+ m_out_tbo_cb(m_to[param]);
break;
case TIMER_C:
- m_out_tco_cb(m_to[index]);
+ m_out_tco_cb(m_to[param]);
break;
case TIMER_D:
- m_out_tdo_cb(m_to[index]);
+ m_out_tdo_cb(m_to[param]);
break;
}
- if (m_ier & (1 << INT_LEVEL_TIMER[index]))
+ if (m_ier & (1 << INT_LEVEL_TIMER[param]))
{
- LOG("Z80STI for Timer %c\n", 'A' + index);
+ LOG("Z80STI for Timer %c\n", 'A' + param);
// signal timer elapsed interrupt
- take_interrupt(INT_LEVEL_TIMER[index]);
+ take_interrupt(INT_LEVEL_TIMER[param]);
}
// load timer main counter
- m_tmc[index] = m_tdr[index];
+ m_tmc[param] = m_tdr[param];
}
else
{
// count down
- m_tmc[index]--;
+ m_tmc[param]--;
}
}