summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author dxl <41547105+hp9k@users.noreply.github.com>2018-10-12 16:57:44 +0200
committer R. Belmont <rb6502@users.noreply.github.com>2018-10-12 10:57:44 -0400
commit5f86b39c0d5c91890e9751855dac7d84a75a016b (patch)
tree424ac8f87d2a5567ecd6f6606b628c23e0890298
parent28fb2156fb3ffe22bc545a08fdd52338980a5214 (diff)
hp9k_3xx: timer fixes (#4131)
* hp9k_3xx: use delegate for timer * mb87030: use delegate for timer * hp9122c: use delegate for timer
-rw-r--r--src/devices/bus/ieee488/hp9122c.cpp4
-rw-r--r--src/devices/bus/ieee488/hp9122c.h2
-rw-r--r--src/devices/machine/mb87030.cpp24
-rw-r--r--src/devices/machine/mb87030.h4
-rw-r--r--src/devices/video/nereid.cpp2
-rw-r--r--src/mame/drivers/hp9k_3xx.cpp6
6 files changed, 21 insertions, 21 deletions
diff --git a/src/devices/bus/ieee488/hp9122c.cpp b/src/devices/bus/ieee488/hp9122c.cpp
index ca4da9a3814..26f36da6ab2 100644
--- a/src/devices/bus/ieee488/hp9122c.cpp
+++ b/src/devices/bus/ieee488/hp9122c.cpp
@@ -86,10 +86,10 @@ void hp9122c_device::device_start()
save_item(NAME(m_ds0));
save_item(NAME(m_ds1));
- m_motor_timer = timer_alloc(0);
+ m_motor_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hp9122c_device::motor_timeout), this));
}
-void hp9122c_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(hp9122c_device::motor_timeout)
{
floppy_image_device *floppy0 = m_floppy[0]->get_device();
floppy_image_device *floppy1 = m_floppy[1]->get_device();
diff --git a/src/devices/bus/ieee488/hp9122c.h b/src/devices/bus/ieee488/hp9122c.h
index 4bd51888e26..66ef36a3fae 100644
--- a/src/devices/bus/ieee488/hp9122c.h
+++ b/src/devices/bus/ieee488/hp9122c.h
@@ -118,7 +118,6 @@ private:
DECLARE_WRITE8_MEMBER(fdc_write);
void cpu_map(address_map &map);
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
required_device<cpu_device> m_cpu;
required_device<i8291a_device> m_i8291a;
@@ -145,6 +144,7 @@ private:
bool m_ds0;
bool m_ds1;
+ TIMER_CALLBACK_MEMBER(motor_timeout);
emu_timer *m_motor_timer;
};
diff --git a/src/devices/machine/mb87030.cpp b/src/devices/machine/mb87030.cpp
index 63fd4b67272..8cafde3ba11 100644
--- a/src/devices/machine/mb87030.cpp
+++ b/src/devices/machine/mb87030.cpp
@@ -132,18 +132,16 @@ void mb87030_device::update_state(mb87030_device::State new_state, int delay, in
m_timer->reset();
}
-void mb87030_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(mb87030_device::timeout)
{
- switch(id) {
- case TimerId::Delay:
- m_delay_timer->reset();
- step(false);
- break;
- case TimerId::Timeout:
- m_timer->reset();
- step(true);
- break;
- }
+ m_timer->reset();
+ step(true);
+}
+
+TIMER_CALLBACK_MEMBER(mb87030_device::delay_timeout)
+{
+ m_delay_timer->reset();
+ step(false);
}
void mb87030_device::scsi_command_complete()
@@ -432,8 +430,8 @@ void mb87030_device::step(bool timeout)
void mb87030_device::device_start()
{
- m_timer = timer_alloc(TimerId::Timeout);
- m_delay_timer = timer_alloc(TimerId::Delay);
+ m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mb87030_device::timeout), this));
+ m_delay_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mb87030_device::delay_timeout), this));
m_irq_handler.resolve_safe();
m_dreq_handler.resolve_safe();
diff --git a/src/devices/machine/mb87030.h b/src/devices/machine/mb87030.h
index 3b5945434a1..7ce8c85c8e2 100644
--- a/src/devices/machine/mb87030.h
+++ b/src/devices/machine/mb87030.h
@@ -181,10 +181,12 @@ private:
uint32_t scsi_get_ctrl();
void step(bool timeout);
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
devcb_write_line m_irq_handler;
devcb_write_line m_dreq_handler;
+ TIMER_CALLBACK_MEMBER(delay_timeout);
+ TIMER_CALLBACK_MEMBER(timeout);
+
// registers
uint8_t m_bdid;
uint8_t m_sctl;
diff --git a/src/devices/video/nereid.cpp b/src/devices/video/nereid.cpp
index 39ddff2897c..7cbaf5fa252 100644
--- a/src/devices/video/nereid.cpp
+++ b/src/devices/video/nereid.cpp
@@ -4,7 +4,7 @@
#include "emu.h"
#include "nereid.h"
-//#define VERBOSE 1
+#define VERBOSE 1
#include "logmacro.h"
DEFINE_DEVICE_TYPE(NEREID, nereid_device, "nereid", "HP Nereid ASIC")
diff --git a/src/mame/drivers/hp9k_3xx.cpp b/src/mame/drivers/hp9k_3xx.cpp
index 267a3f08bfd..faa2957806c 100644
--- a/src/mame/drivers/hp9k_3xx.cpp
+++ b/src/mame/drivers/hp9k_3xx.cpp
@@ -100,7 +100,6 @@ private:
output_finder<8> m_diag_led;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
void set_bus_error(uint32_t address, bool write, uint16_t mem_mask);
DECLARE_READ16_MEMBER(buserror16_r);
@@ -133,6 +132,7 @@ private:
bool m_bus_error;
emu_timer *m_bus_error_timer;
+ TIMER_CALLBACK_MEMBER(bus_error_timeout);
};
// shared mappings for all 9000/3xx systems
@@ -244,11 +244,11 @@ void hp9k3xx_state::machine_reset()
void hp9k3xx_state::machine_start()
{
- m_bus_error_timer = timer_alloc(0);
+ m_bus_error_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(hp9k3xx_state::bus_error_timeout), this));
save_item(NAME(m_bus_error));
}
-void hp9k3xx_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
+TIMER_CALLBACK_MEMBER(hp9k3xx_state::bus_error_timeout)
{
m_bus_error = false;
}