summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2017-06-18 23:59:10 -0400
committer AJR <ajrhacker@users.noreply.github.com>2017-06-18 23:59:10 -0400
commit463dce64a06edb409c550dda026087485e976d72 (patch)
tree3c0c838ac1d53cbf2ef4f4b288fc57dfc26f3e06
parentf4ade367fb3560e7bb34811134557f144bff4fbc (diff)
Remove timer_set from src/devices/bus (nw)
-rw-r--r--src/devices/bus/centronics/epson_lx810l.cpp6
-rw-r--r--src/devices/bus/centronics/epson_lx810l.h2
-rw-r--r--src/devices/bus/centronics/printer.cpp11
-rw-r--r--src/devices/bus/centronics/printer.h3
4 files changed, 16 insertions, 6 deletions
diff --git a/src/devices/bus/centronics/epson_lx810l.cpp b/src/devices/bus/centronics/epson_lx810l.cpp
index e9dbe316d30..3f426f6021f 100644
--- a/src/devices/bus/centronics/epson_lx810l.cpp
+++ b/src/devices/bus/centronics/epson_lx810l.cpp
@@ -313,6 +313,8 @@ epson_ap2000_device::epson_ap2000_device(const machine_config &mconfig, const ch
void epson_lx810l_device::device_start()
{
+ m_cr_timer = timer_alloc(TIMER_CR);
+
machine().first_screen()->register_screen_bitmap(m_bitmap);
m_bitmap.fill(0xffffff); /* Start with a clean white piece of paper */
}
@@ -344,7 +346,7 @@ void epson_lx810l_device::device_timer(emu_timer &timer, device_timer_id id, int
m_real_cr_pos += param;
m_real_cr_steps--;
if (m_real_cr_steps)
- timer_set(attotime::from_usec(400), TIMER_CR, m_real_cr_dir);
+ m_cr_timer->adjust(attotime::from_usec(400), m_real_cr_dir);
break;
}
}
@@ -516,7 +518,7 @@ WRITE8_MEMBER( epson_lx810l_device::cr_stepper )
}
if (!m_real_cr_steps)
- timer_set(attotime::from_usec(400), TIMER_CR, m_real_cr_dir);
+ m_cr_timer->adjust(attotime::from_usec(400), m_real_cr_dir);
m_real_cr_steps++;
LX810LLOG("%s: %s(%02x); abs %d\n", machine().describe_context(), __func__, data, m_cr_pos_abs);
diff --git a/src/devices/bus/centronics/epson_lx810l.h b/src/devices/bus/centronics/epson_lx810l.h
index d8add7e8b4e..76c4beadd72 100644
--- a/src/devices/bus/centronics/epson_lx810l.h
+++ b/src/devices/bus/centronics/epson_lx810l.h
@@ -134,6 +134,8 @@ private:
enum {
TIMER_CR
};
+
+ emu_timer *m_cr_timer;
};
// ======================> epson_ap2000_t
diff --git a/src/devices/bus/centronics/printer.cpp b/src/devices/bus/centronics/printer.cpp
index ff926f5ad7e..fdc7548438d 100644
--- a/src/devices/bus/centronics/printer.cpp
+++ b/src/devices/bus/centronics/printer.cpp
@@ -60,7 +60,7 @@ void centronics_printer_device::device_timer(emu_timer &timer, device_timer_id i
m_printer->output(m_data);
/* ready to receive more data, return BUSY to low */
- timer_set(attotime::from_usec(7), TIMER_BUSY, false);
+ m_busy_timer->adjust(attotime::from_usec(7), false);
}
break;
@@ -71,18 +71,21 @@ void centronics_printer_device::device_timer(emu_timer &timer, device_timer_id i
if (param == true)
{
/* timer to turn ACK low to receive data */
- timer_set(attotime::from_usec(10), TIMER_ACK, false);
+ m_ack_timer->adjust(attotime::from_usec(10), false);
}
else
{
/* timer to return ACK to high state */
- timer_set(attotime::from_usec(5), TIMER_ACK, true);
+ m_ack_timer->adjust(attotime::from_usec(5), true);
}
}
}
void centronics_printer_device::device_start()
{
+ m_ack_timer = timer_alloc(TIMER_ACK);
+ m_busy_timer = timer_alloc(TIMER_BUSY);
+
/* register for state saving */
save_item(NAME(m_strobe));
save_item(NAME(m_data));
@@ -109,7 +112,7 @@ WRITE_LINE_MEMBER( centronics_printer_device::input_strobe )
if (m_strobe == true && state == false && m_busy == false)
{
/* STROBE has gone low, data is ready */
- timer_set(attotime::zero, TIMER_BUSY, true);
+ m_busy_timer->adjust(attotime::zero, true);
}
m_strobe = state;
diff --git a/src/devices/bus/centronics/printer.h b/src/devices/bus/centronics/printer.h
index df767a9c5ab..8e564ff5df9 100644
--- a/src/devices/bus/centronics/printer.h
+++ b/src/devices/bus/centronics/printer.h
@@ -44,6 +44,9 @@ private:
TIMER_BUSY
};
+ emu_timer *m_ack_timer;
+ emu_timer *m_busy_timer;
+
int m_strobe;
uint8_t m_data;
int m_busy;