mirror of
https://github.com/holub/mame
synced 2025-10-09 09:44:40 +03:00
diexec.cpp: Fix formatting and validation mistake (nw)
This commit is contained in:
parent
18edbdcc71
commit
269b06a99b
@ -46,7 +46,7 @@ device_execute_interface::device_execute_interface(const machine_config &mconfig
|
|||||||
: device_interface(device, "execute")
|
: device_interface(device, "execute")
|
||||||
, m_scheduler(nullptr)
|
, m_scheduler(nullptr)
|
||||||
, m_disabled(false)
|
, m_disabled(false)
|
||||||
, m_vblank_interrupt_screen(nullptr)
|
, m_vblank_interrupt_screen(nullptr)
|
||||||
, m_timed_interrupt_period(attotime::zero)
|
, m_timed_interrupt_period(attotime::zero)
|
||||||
, m_nextexec(nullptr)
|
, m_nextexec(nullptr)
|
||||||
, m_timedint_timer(nullptr)
|
, m_timedint_timer(nullptr)
|
||||||
@ -345,14 +345,14 @@ void device_execute_interface::execute_set_input(int linenum, int state)
|
|||||||
void device_execute_interface::interface_validity_check(validity_checker &valid) const
|
void device_execute_interface::interface_validity_check(validity_checker &valid) const
|
||||||
{
|
{
|
||||||
// validate the interrupts
|
// validate the interrupts
|
||||||
if (m_vblank_interrupt.isnull())
|
if (!m_vblank_interrupt.isnull())
|
||||||
{
|
{
|
||||||
screen_device_iterator iter(device().mconfig().root_device());
|
screen_device_iterator iter(device().mconfig().root_device());
|
||||||
if (iter.first() == nullptr)
|
if (iter.first() == nullptr)
|
||||||
osd_printf_error("VBLANK interrupt specified, but the driver is screenless\n");
|
osd_printf_error("VBLANK interrupt specified, but the driver is screenless\n");
|
||||||
else if (m_vblank_interrupt_screen != nullptr && device().siblingdevice(m_vblank_interrupt_screen) == nullptr)
|
else if (m_vblank_interrupt_screen != nullptr && device().siblingdevice(m_vblank_interrupt_screen) == nullptr)
|
||||||
osd_printf_error("VBLANK interrupt references a non-existant screen tag '%s'\n", m_vblank_interrupt_screen);
|
osd_printf_error("VBLANK interrupt references a non-existant screen tag '%s'\n", m_vblank_interrupt_screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_timed_interrupt.isnull() && m_timed_interrupt_period == attotime::zero)
|
if (!m_timed_interrupt.isnull() && m_timed_interrupt_period == attotime::zero)
|
||||||
osd_printf_error("Timed interrupt handler specified with 0 period\n");
|
osd_printf_error("Timed interrupt handler specified with 0 period\n");
|
||||||
@ -443,14 +443,14 @@ void device_execute_interface::interface_post_reset()
|
|||||||
elem.reset();
|
elem.reset();
|
||||||
|
|
||||||
// reconfingure VBLANK interrupts
|
// reconfingure VBLANK interrupts
|
||||||
if (m_vblank_interrupt_screen != nullptr)
|
if (m_vblank_interrupt_screen != nullptr)
|
||||||
{
|
{
|
||||||
// get the screen that will trigger the VBLANK
|
// get the screen that will trigger the VBLANK
|
||||||
screen_device * screen = device().siblingdevice<screen_device>(m_vblank_interrupt_screen);
|
screen_device * screen = device().siblingdevice<screen_device>(m_vblank_interrupt_screen);
|
||||||
|
|
||||||
assert(screen != nullptr);
|
assert(screen != nullptr);
|
||||||
screen->register_vblank_callback(vblank_state_delegate(&device_execute_interface::on_vblank, this));
|
screen->register_vblank_callback(vblank_state_delegate(&device_execute_interface::on_vblank, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
// reconfigure periodic interrupts
|
// reconfigure periodic interrupts
|
||||||
if (m_timed_interrupt_period != attotime::zero)
|
if (m_timed_interrupt_period != attotime::zero)
|
||||||
|
Loading…
Reference in New Issue
Block a user