mirror of
https://github.com/holub/mame
synced 2025-05-11 00:28:49 +03:00
simpler implementation of MCFG_DEVICE_{VBLANK|PRIODIC}_INT_REMOVE (nw)
This commit is contained in:
parent
b4117331a6
commit
c2ee7aad41
@ -140,19 +140,6 @@ void device_execute_interface::static_set_vblank_int(device_t &device, device_in
|
||||
exec->m_vblank_interrupt_screen = tag;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// static_remove_vblank_int - configuration helper
|
||||
// to remove VBLANK interrupts from the device
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_execute_interface::static_remove_vblank_int(device_t &device)
|
||||
{
|
||||
device_execute_interface *exec;
|
||||
if (!device.interface(exec))
|
||||
throw emu_fatalerror("MCFG_DEVICE_VBLANK_INT_REMOVE called on device '%s' with no execute interface", device.tag());
|
||||
exec->m_vblank_interrupt = device_interrupt_delegate();
|
||||
exec->m_vblank_interrupt_screen = NULL;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// static_set_periodic_int - configuration helper
|
||||
@ -178,21 +165,6 @@ void device_execute_interface::static_set_periodic_int(device_t &device, device_
|
||||
exec->m_timed_interrupt_period = rate;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// static_remove_periodic_int - configuration helper
|
||||
// to remove periodic interrupts from the device
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_execute_interface::static_remove_periodic_int(device_t &device)
|
||||
{
|
||||
device_execute_interface *exec;
|
||||
if (!device.interface(exec))
|
||||
throw emu_fatalerror("MCFG_DEVICE_PERIODIC_INT_REMOVE called on device '%s' with no execute interface", device.tag());
|
||||
exec->m_timed_interrupt = device_interrupt_delegate();
|
||||
exec->m_timed_interrupt_legacy = NULL;
|
||||
exec->m_timed_interrupt_period = attotime();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// executing - return true if this device is
|
||||
|
@ -121,7 +121,7 @@ enum
|
||||
#define MCFG_DEVICE_VBLANK_INT_DEVICE(_tag, _devtag, _class, _func) \
|
||||
device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, _devtag, (_class *)0), _tag);
|
||||
#define MCFG_DEVICE_VBLANK_INT_REMOVE() \
|
||||
device_execute_interface::static_remove_vblank_int(*device);
|
||||
device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(), NULL);
|
||||
// legacy
|
||||
#define MCFG_DEVICE_PERIODIC_INT(_func, _rate) \
|
||||
device_execute_interface::static_set_periodic_int(*device, _func, attotime::from_hz(_rate));
|
||||
@ -130,7 +130,7 @@ enum
|
||||
#define MCFG_DEVICE_PERIODIC_INT_DEVICE(_devtag, _class, _func, _rate) \
|
||||
device_execute_interface::static_set_periodic_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, _devtag, (_class *)0), attotime::from_hz(_rate));
|
||||
#define MCFG_DEVICE_PERIODIC_INT_REMOVE() \
|
||||
device_execute_interface::static_remove_periodic_int(*device);
|
||||
device_execute_interface::static_set_periodic_int(*device, device_interrupt_delegate(), attotime());
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user