mirror of
https://github.com/holub/mame
synced 2025-04-26 02:07:14 +03:00
fixup, improve validation (nw)
This commit is contained in:
parent
d1f0520444
commit
ff9123d8ef
@ -345,13 +345,12 @@ void device_execute_interface::execute_set_input(int linenum, int state)
|
||||
void device_execute_interface::interface_validity_check(validity_checker &valid) const
|
||||
{
|
||||
// validate the interrupts
|
||||
if (!m_vblank_interrupt.isnull())
|
||||
if (!m_vblank_interrupt_screen)
|
||||
{
|
||||
screen_device_iterator iter(device().mconfig().root_device());
|
||||
if (iter.first() == nullptr)
|
||||
osd_printf_error("VBLANK interrupt specified, but the driver is screenless\n");
|
||||
else if (m_vblank_interrupt_screen == nullptr)
|
||||
osd_printf_error("VBLANK interrupt references a non-existant screen tag\n");
|
||||
if (m_vblank_interrupt_screen.finder_tag() != finder_base::DUMMY_TAG)
|
||||
osd_printf_error("VBLANK interrupt references non-existent screen tag %s\n", m_vblank_interrupt_screen.finder_tag());
|
||||
else if (!m_vblank_interrupt.isnull())
|
||||
osd_printf_error("VBLANK interrupt specified, but no screen configured\n");
|
||||
}
|
||||
|
||||
if (!m_timed_interrupt.isnull() && m_timed_interrupt_period == attotime::zero)
|
||||
@ -444,9 +443,7 @@ void device_execute_interface::interface_post_reset()
|
||||
|
||||
// reconfingure VBLANK interrupts
|
||||
if (m_vblank_interrupt_screen)
|
||||
{
|
||||
m_vblank_interrupt_screen->register_vblank_callback(vblank_state_delegate(&device_execute_interface::on_vblank, this));
|
||||
}
|
||||
|
||||
// reconfigure periodic interrupts
|
||||
if (m_timed_interrupt_period != attotime::zero)
|
||||
|
@ -86,7 +86,7 @@ enum
|
||||
#define MCFG_DEVICE_VBLANK_INT_DEVICE(_tag, _devtag, _class, _func) \
|
||||
dynamic_cast<device_execute_interface &>(*device).set_vblank_int(device_interrupt_delegate(&_class::_func, #_class "::" #_func, _devtag, (_class *)nullptr), _tag);
|
||||
#define MCFG_DEVICE_VBLANK_INT_REMOVE() \
|
||||
dynamic_cast<device_execute_interface &>(*device).set_vblank_int(device_interrupt_delegate(), nullptr);
|
||||
dynamic_cast<device_execute_interface &>(*device).set_vblank_int(device_interrupt_delegate(), finder_base::DUMMY_TAG);
|
||||
#define MCFG_DEVICE_PERIODIC_INT_DRIVER(_class, _func, _rate) \
|
||||
dynamic_cast<device_execute_interface &>(*device).set_periodic_int(device_interrupt_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)nullptr), attotime::from_hz(_rate));
|
||||
#define MCFG_DEVICE_PERIODIC_INT_DEVICE(_devtag, _class, _func, _rate) \
|
||||
|
@ -630,12 +630,13 @@ void screen_device::device_validity_check(validity_checker &valid) const
|
||||
osd_printf_error("Invalid (zero) refresh rate\n");
|
||||
|
||||
texture_format texformat = !m_screen_update_ind16.isnull() ? TEXFORMAT_PALETTE16 : TEXFORMAT_RGB32;
|
||||
if (m_palette != nullptr)
|
||||
if (m_palette.finder_tag() != finder_base::DUMMY_TAG)
|
||||
{
|
||||
if (!m_palette)
|
||||
osd_printf_error("Screen references non-existent palette tag %s\n", m_palette.finder_tag());
|
||||
|
||||
if (texformat == TEXFORMAT_RGB32)
|
||||
{
|
||||
osd_printf_warning("Screen does not need palette defined\n");
|
||||
}
|
||||
}
|
||||
else if (texformat == TEXFORMAT_PALETTE16)
|
||||
{
|
||||
@ -659,9 +660,7 @@ void screen_device::device_resolve_objects()
|
||||
|
||||
// assign our format to the palette before it starts
|
||||
if (m_palette)
|
||||
{
|
||||
m_palette->m_format = format();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -689,7 +688,7 @@ void screen_device::device_start()
|
||||
}
|
||||
|
||||
// if we have a palette and it's not started, wait for it
|
||||
if (m_palette != nullptr && !m_palette->device().started())
|
||||
if (m_palette && !m_palette->device().started())
|
||||
throw device_missing_dependencies();
|
||||
|
||||
// configure bitmap formats and allocate screen bitmaps
|
||||
@ -962,7 +961,7 @@ void screen_device::realloc_screen_bitmaps()
|
||||
item->m_bitmap.resize(effwidth, effheight);
|
||||
|
||||
// re-set up textures
|
||||
if (m_palette != nullptr)
|
||||
if (m_palette)
|
||||
{
|
||||
m_bitmap[0].set_palette(m_palette->palette());
|
||||
m_bitmap[1].set_palette(m_palette->palette());
|
||||
@ -1334,7 +1333,7 @@ void screen_device::register_screen_bitmap(bitmap_t &bitmap)
|
||||
|
||||
// if allocating now, just do it
|
||||
bitmap.allocate(width(), height());
|
||||
if (m_palette != nullptr)
|
||||
if (m_palette)
|
||||
bitmap.set_palette(m_palette->palette());
|
||||
}
|
||||
|
||||
|
@ -309,7 +309,7 @@ private:
|
||||
screen_update_ind16_delegate m_screen_update_ind16; // screen update callback (16-bit palette)
|
||||
screen_update_rgb32_delegate m_screen_update_rgb32; // screen update callback (32-bit RGB)
|
||||
devcb_write_line m_screen_vblank; // screen vblank line callback
|
||||
optional_device<palette_device> m_palette; // our palette
|
||||
optional_device<device_palette_interface> m_palette; // our palette
|
||||
u32 m_video_attributes; // flags describing the video system
|
||||
const char * m_svg_region; // the region in which the svg data is in
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user