screen: draw until current hpos (not inclusive) when doing an update_now

This commit is contained in:
hap 2022-04-03 22:31:54 +02:00
parent 67f95f7f75
commit 07a357463b
2 changed files with 45 additions and 42 deletions

View File

@ -555,7 +555,7 @@ screen_device::screen_device(const machine_config &mconfig, const char *tag, dev
, m_curtexture(0)
, m_changed(true)
, m_last_partial_scan(0)
, m_partial_scan_hpos(-1)
, m_partial_scan_hpos(0)
, m_color(rgb_t(0xff, 0xff, 0xff, 0xff))
, m_brightness(0xff)
, m_frame_period(DEFAULT_FRAME_PERIOD.as_attoseconds())
@ -1245,7 +1245,7 @@ bool screen_device::update_partial(int scanline)
// remember where we left off
m_last_partial_scan = scanline + 1;
m_partial_scan_hpos = -1;
m_partial_scan_hpos = 0;
return true;
}
@ -1299,10 +1299,10 @@ void screen_device::update_now()
if (current_vpos > m_last_partial_scan)
{
// if the line before us was incomplete, we must do it in two pieces
if (m_partial_scan_hpos >= 0)
if (m_partial_scan_hpos > 0)
{
// now finish the previous partial scanline
clip.set((std::max)(clip.left(), m_partial_scan_hpos + 1),
clip.set((std::max)(clip.left(), m_partial_scan_hpos),
clip.right(),
(std::max)(clip.top(), m_last_partial_scan),
(std::min)(clip.bottom(), m_last_partial_scan));
@ -1341,7 +1341,7 @@ void screen_device::update_now()
m_changed |= ~flags & UPDATE_HAS_NOT_CHANGED;
}
m_partial_scan_hpos = -1;
m_partial_scan_hpos = 0;
m_last_partial_scan++;
}
if (current_vpos > m_last_partial_scan)
@ -1351,10 +1351,12 @@ void screen_device::update_now()
}
// now draw this partial scanline
if (current_hpos > 0)
{
clip = m_visarea;
clip.set((std::max)(clip.left(), m_partial_scan_hpos + 1),
(std::min)(clip.right(), current_hpos),
clip.set((std::max)(clip.left(), m_partial_scan_hpos),
(std::min)(clip.right(), current_hpos - 1),
(std::max)(clip.top(), current_vpos),
(std::min)(clip.bottom(), current_vpos));
@ -1393,6 +1395,7 @@ void screen_device::update_now()
// if we modified the bitmap, we have to commit
m_changed |= ~flags & UPDATE_HAS_NOT_CHANGED;
}
}
// remember where we left off
m_partial_scan_hpos = current_hpos;
@ -1408,7 +1411,7 @@ void screen_device::update_now()
void screen_device::reset_partial_updates()
{
m_last_partial_scan = 0;
m_partial_scan_hpos = -1;
m_partial_scan_hpos = 0;
m_partial_updates_this_frame = 0;
m_scanline0_timer->adjust(time_until_pos(0));
}

View File

@ -597,7 +597,7 @@ bool video_manager::finish_screen_updates()
bool has_live_screen = false;
for (screen_device &screen : iter)
{
if (screen.partial_scan_hpos() >= 0) // previous update ended mid-scanline
if (screen.partial_scan_hpos() > 0) // previous update ended mid-scanline
screen.update_now();
screen.update_partial(screen.visible_area().max_y);