diff options
Diffstat (limited to 'src/devices/machine/gt913_io.cpp')
-rw-r--r-- | src/devices/machine/gt913_io.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/devices/machine/gt913_io.cpp b/src/devices/machine/gt913_io.cpp index 2853a50ec98..d1b091fa308 100644 --- a/src/devices/machine/gt913_io.cpp +++ b/src/devices/machine/gt913_io.cpp @@ -32,8 +32,8 @@ void gt913_io_hle_device::device_start() m_cpu_io = &m_cpu->space(AS_IO); m_intc = siblingdevice<h8_intc_device>(m_intc_tag); - m_timer[0] = timer_alloc(0); - m_timer[1] = timer_alloc(1); + m_timer[0] = timer_alloc(FUNC(gt913_io_hle_device::irq_timer_tick), this); + m_timer[1] = timer_alloc(FUNC(gt913_io_hle_device::irq_timer_tick), this); save_item(NAME(m_timer_control)); save_item(NAME(m_timer_rate)); @@ -54,10 +54,10 @@ void gt913_io_hle_device::device_reset() m_adc_data[0] = m_adc_data[1] = 0; } -void gt913_io_hle_device::device_timer(emu_timer &timer, device_timer_id id, int param) +TIMER_CALLBACK_MEMBER(gt913_io_hle_device::irq_timer_tick) { - m_timer_irq_pending[id] = true; - timer_check_irq(id); + m_timer_irq_pending[param] = true; + timer_check_irq((offs_t)param); } void gt913_io_hle_device::timer_control_w(offs_t offset, uint8_t data) @@ -65,7 +65,7 @@ void gt913_io_hle_device::timer_control_w(offs_t offset, uint8_t data) assert(offset < 2); // TODO: ctk551 clears and sets bit 4 during the respective timer's IRQ, what should this do? pause/restart the timer? m_timer_control[offset] = data; - timer_check_irq(offset); + timer_check_irq((int)offset); } uint8_t gt913_io_hle_device::timer_control_r(offs_t offset) @@ -106,15 +106,16 @@ void gt913_io_hle_device::timer_adjust(offs_t num) { default: logerror("unknown timer %u prescaler %u (pc = %04x)\n", num, m_timer_control[num] & 0x7, m_cpu->pc()); - [[fallthrough]]; + break; case 0: break; case 2: - clocks <<= 9; break; + clocks <<= 9; + break; } attotime period = m_cpu->clocks_to_attotime(clocks); - m_timer[num]->adjust(period, 0, period); + m_timer[num]->adjust(period, (int)num, period); } } |