mirror of
https://github.com/holub/mame
synced 2025-06-05 04:16:28 +03:00
hp9k_3xx: timer fixes (#4131)
* hp9k_3xx: use delegate for timer * mb87030: use delegate for timer * hp9122c: use delegate for timer
This commit is contained in:
parent
28fb2156fb
commit
5f86b39c0d
@ -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();
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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")
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user