From 898907380ebcfc89cd1810a08f83ce045c2ed109 Mon Sep 17 00:00:00 2001 From: enikland2 Date: Sat, 25 May 2019 18:01:11 -0300 Subject: fix screen_device::update_now() when drawing partial lines (#5109) -screen: Fixed update_now() when drawing partial lines. [Enik Land] -screen: Fixed pixel-access functions to use the current bitmap. [Enik Land] --- src/emu/screen.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index 77efffc970b..d6df45a8c4f 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -1151,20 +1151,12 @@ void screen_device::update_now() // if the line before us was incomplete, we must do it in two pieces if (m_partial_scan_hpos > 0) { - if (current_vpos > 1) - { - s32 save_scan = m_partial_scan_hpos; - update_partial(current_vpos - 2); - m_partial_scan_hpos = save_scan; - } - // now finish the previous partial scanline - int scanline = current_vpos - 1; clip.set( (std::max)(clip.left(), m_partial_scan_hpos), - (std::min)(clip.right(), current_hpos), + clip.right(), (std::max)(clip.top(), m_last_partial_scan), - (std::min)(clip.bottom(), scanline)); + (std::min)(clip.bottom(), m_last_partial_scan)); // if there's something to draw, do it if (!clip.empty()) @@ -1182,10 +1174,10 @@ void screen_device::update_now() m_partial_updates_this_frame++; g_profiler.stop(); m_partial_scan_hpos = 0; - m_last_partial_scan = current_vpos + 1; + m_last_partial_scan++; } } - else + if (current_vpos > m_last_partial_scan) { update_partial(current_vpos - 1); } @@ -1257,7 +1249,7 @@ void screen_device::reset_partial_updates() u32 screen_device::pixel(s32 x, s32 y) { - screen_bitmap &curbitmap = m_bitmap[m_curtexture]; + screen_bitmap &curbitmap = m_bitmap[m_curbitmap]; if (!curbitmap.valid()) return 0; @@ -1297,7 +1289,7 @@ u32 screen_device::pixel(s32 x, s32 y) void screen_device::pixels(u32 *buffer) { - screen_bitmap &curbitmap = m_bitmap[m_curtexture]; + screen_bitmap &curbitmap = m_bitmap[m_curbitmap]; if (!curbitmap.valid()) return; -- cgit v1.2.3