summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/mb8795.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/mb8795.cpp')
-rw-r--r--src/devices/machine/mb8795.cpp38
1 files changed, 15 insertions, 23 deletions
diff --git a/src/devices/machine/mb8795.cpp b/src/devices/machine/mb8795.cpp
index 4f6d08d9aca..7d619a18d90 100644
--- a/src/devices/machine/mb8795.cpp
+++ b/src/devices/machine/mb8795.cpp
@@ -38,22 +38,17 @@ void mb8795_device::check_irq()
bool old_irq_rx = irq_rx;
irq_tx = txstat & txmask;
irq_rx = rxstat & rxmask;
- if(irq_tx != old_irq_tx && !irq_tx_cb.isnull())
+ if(irq_tx != old_irq_tx)
irq_tx_cb(irq_tx);
- if(irq_rx != old_irq_rx && !irq_rx_cb.isnull())
+ if(irq_rx != old_irq_rx)
irq_rx_cb(irq_rx);
}
void mb8795_device::device_start()
{
- irq_tx_cb.resolve();
- irq_rx_cb.resolve();
- drq_tx_cb.resolve();
- drq_rx_cb.resolve();
-
memset(mac, 0, 6);
- timer_tx = timer_alloc(TIMER_TX);
- timer_rx = timer_alloc(TIMER_RX);
+ timer_tx = timer_alloc(FUNC(mb8795_device::tx_update), this);
+ timer_rx = timer_alloc(FUNC(mb8795_device::rx_update), this);
}
void mb8795_device::device_reset()
@@ -185,7 +180,7 @@ void mb8795_device::mac_w(offs_t offset, uint8_t data)
{
if(offset < 6) {
mac[offset] = data;
- set_mac((const char *)mac);
+ set_mac(mac);
}
}
@@ -203,8 +198,7 @@ void mb8795_device::tx_dma_w(uint8_t data, bool eof)
}
drq_tx = false;
- if(!drq_tx_cb.isnull())
- drq_tx_cb(drq_tx);
+ drq_tx_cb(drq_tx);
if(eof) {
logerror("send packet, dest=%02x.%02x.%02x.%02x.%02x.%02x len=%04x loopback=%s\n",
@@ -232,8 +226,7 @@ void mb8795_device::tx_dma_w(uint8_t data, bool eof)
void mb8795_device::rx_dma_r(uint8_t &data, bool &eof)
{
drq_rx = false;
- if(!drq_rx_cb.isnull())
- drq_rx_cb(drq_rx);
+ drq_rx_cb(drq_rx);
if(rxlen) {
data = rxbuf[0];
@@ -323,17 +316,16 @@ bool mb8795_device::recv_is_multicast()
return rxbuf[0] & 0x01;
}
-void mb8795_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(mb8795_device::tx_update)
{
- if(id == TIMER_TX) {
- drq_tx = true;
- if(!drq_tx_cb.isnull())
- drq_tx_cb(drq_tx);
- }
+ drq_tx = true;
+ drq_tx_cb(drq_tx);
+}
- if(id == TIMER_RX && rxlen) {
+TIMER_CALLBACK_MEMBER(mb8795_device::rx_update)
+{
+ if(rxlen) {
drq_rx = true;
- if(!drq_rx_cb.isnull())
- drq_rx_cb(drq_rx);
+ drq_rx_cb(drq_rx);
}
}