From c2155411874230f424f3636e477a9cfeeebb23cb Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 24 Feb 2025 22:45:42 +0100 Subject: screen: fix possible race condition at reset_origin if vblank start == vblank end --- src/emu/screen.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index 8082b7ddad2..6720d3e85e8 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -1042,19 +1042,19 @@ void screen_device::reset_origin(int beamy, int beamx) m_vblank_end_time = curtime - attotime(0, beamy * m_scantime + beamx * m_pixeltime); m_vblank_start_time = m_vblank_end_time - attotime(0, m_vblank_period); - // if we are resetting relative to (0,0) == VBLANK end, call the - // scanline 0 timer by hand now; otherwise, adjust it for the future - if (beamy == 0 && beamx == 0) - reset_partial_updates(); - else - m_scanline0_timer->adjust(time_until_pos(0)); - // if we are resetting relative to (visarea.bottom() + 1, 0) == VBLANK start, // call the VBLANK start timer now; otherwise, adjust it for the future if (beamy == ((m_visarea.bottom() + 1) % m_height) && beamx == 0) vblank_begin(0); else m_vblank_begin_timer->adjust(time_until_vblank_start()); + + // if we are resetting relative to (0,0) == VBLANK end, call the + // scanline 0 timer by hand now; otherwise, adjust it for the future + if (beamy == 0 && beamx == 0) + reset_partial_updates(); + else + m_scanline0_timer->adjust(time_until_pos(0)); } -- cgit v1.2.3-70-g09d2