Address performance concerns with previous change to screen.h/.cpp, nw

This commit is contained in:
mooglyguy 2018-03-11 21:26:01 +01:00
parent 2f13e9b319
commit 67627369dd
2 changed files with 6 additions and 2 deletions

View File

@ -792,6 +792,8 @@ void screen_device::device_start()
save_item(NAME(m_frame_number));
if (m_oldstyle_vblank_supplied)
logerror("%s: Deprecated legacy Old Style screen configured (MCFG_SCREEN_VBLANK_TIME), please use MCFG_SCREEN_RAW_PARAMS instead.\n",this->tag());
m_is_primary_screen = (this == screen_device_iterator(machine().root_device()).first());
}
@ -1368,7 +1370,7 @@ void screen_device::vblank_begin()
m_vblank_end_time = m_vblank_start_time + attotime(0, m_vblank_period);
// if this is the primary screen and we need to update now
if (this == screen_device_iterator(machine().root_device()).first() && !(m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
if (m_is_primary_screen && !(m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
machine().video().frame_update();
// call the screen specific callbacks
@ -1400,7 +1402,7 @@ void screen_device::vblank_end()
m_screen_vblank(0);
// if this is the primary screen and we need to update now
if (this == screen_device_iterator(machine().root_device()).first() && (m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
if (m_is_primary_screen && (m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
machine().video().frame_update();
// increment the frame number counter

View File

@ -354,6 +354,8 @@ private:
u64 m_frame_number; // the current frame number
u32 m_partial_updates_this_frame;// partial update counter this frame
bool m_is_primary_screen;
// VBLANK callbacks
class callback_item
{