diff options
Diffstat (limited to 'src/mame/machine/hpc3.cpp')
-rw-r--r-- | src/mame/machine/hpc3.cpp | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/src/mame/machine/hpc3.cpp b/src/mame/machine/hpc3.cpp index dcab7432baa..89e736c698c 100644 --- a/src/mame/machine/hpc3.cpp +++ b/src/mame/machine/hpc3.cpp @@ -150,7 +150,7 @@ void hpc3_device::device_start() save_item(NAME(m_pbus_dma[i].m_config), i); save_item(NAME(m_pbus_dma[i].m_control), i); - m_pbus_dma[i].m_timer = timer_alloc(TIMER_PBUS_DMA + i); + m_pbus_dma[i].m_timer = timer_alloc(FUNC(hpc3_device::do_pbus_dma), this); m_pbus_dma[i].m_timer->adjust(attotime::never); } @@ -166,7 +166,7 @@ void hpc3_device::device_start() save_pointer(NAME(m_enet_fifo[ENET_RECV]), 32); save_pointer(NAME(m_enet_fifo[ENET_XMIT]), 40); - m_enet_tx_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hpc3_device::enet_transmit), this)); + m_enet_tx_timer = timer_alloc(FUNC(hpc3_device::enet_transmit), this); } void hpc3_device::device_reset() @@ -218,29 +218,9 @@ void hpc3_device::map(address_map &map) map(0x00060000, 0x0007ffff).rw(FUNC(hpc3_device::bbram_r), FUNC(hpc3_device::bbram_w)); } -void hpc3_device::device_timer(emu_timer &timer, device_timer_id id, int param) -{ - switch (id) - { - case TIMER_PBUS_DMA+0: - case TIMER_PBUS_DMA+1: - case TIMER_PBUS_DMA+2: - case TIMER_PBUS_DMA+3: - do_pbus_dma(id - TIMER_PBUS_DMA); - break; - case TIMER_PBUS_DMA+4: - case TIMER_PBUS_DMA+5: - case TIMER_PBUS_DMA+6: - case TIMER_PBUS_DMA+7: - LOGMASKED(LOG_UNKNOWN, "HPC3: Ignoring active PBUS DMA on channel %d\n", id - TIMER_PBUS_DMA); - break; - default: - throw emu_fatalerror("Unknown id in hpc3_device::device_timer"); - } -} - -void hpc3_device::do_pbus_dma(uint32_t channel) +TIMER_CALLBACK_MEMBER(hpc3_device::do_pbus_dma) { + uint32_t channel = (uint32_t)param; pbus_dma_t &dma = m_pbus_dma[channel]; if (dma.m_active && channel < 4) @@ -280,7 +260,7 @@ void hpc3_device::do_pbus_dma(uint32_t channel) return; } } - dma.m_timer->adjust(m_hal2->get_rate(channel)); + dma.m_timer->adjust(m_hal2->get_rate(channel), (int)channel); } else { @@ -881,7 +861,7 @@ void hpc3_device::pbusdma_w(address_space &space, offs_t offset, uint32_t data, attotime rate = m_hal2->get_rate(channel); if (rate != attotime::zero) { - dma.m_timer->adjust(rate); + dma.m_timer->adjust(rate, (int)channel); dma.m_active = true; } } |