From 94a9338a95178c46a3093708f100446dc4393992 Mon Sep 17 00:00:00 2001 From: Mark Garlanger Date: Thu, 7 Dec 2023 09:48:22 -0600 Subject: video/mc6845.cpp: Don't enable line timer until valid parameters are set. (#11803) Fixes hang in ma7551t. --- src/devices/video/mc6845.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp index 4fa82cf6c35..50411c5ed46 100644 --- a/src/devices/video/mc6845.cpp +++ b/src/devices/video/mc6845.cpp @@ -82,6 +82,7 @@ DEFINE_DEVICE_TYPE(AMS40489, ams40489_device, "ams40489", "AMS40489 ASIC (CRTC)" mc6845_device::mc6845_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock) , device_video_interface(mconfig, *this, false) + , m_line_timer(nullptr) , m_show_border_area(true) , m_noninterlace_adjust(0) , m_interlace_adjust(0) @@ -531,6 +532,10 @@ void mc6845_device::recompute_parameters(bool postload) m_hsync_off_pos = hsync_off_pos; m_vsync_on_pos = vsync_on_pos; m_vsync_off_pos = vsync_off_pos; + if (m_line_timer && !m_line_timer->enabled() && m_has_valid_parameters) + { + m_line_timer->adjust(cclks_to_attotime(m_horiz_char_total + 1)); + } if ( (!m_reconfigure_cb.isnull()) && (!postload) ) m_line_counter = 0; } @@ -1301,8 +1306,10 @@ void mc6845_device::device_reset() m_out_vsync_cb(false); - if (!m_line_timer->enabled()) + if (!m_line_timer->enabled() && m_has_valid_parameters) + { m_line_timer->adjust(cclks_to_attotime(m_horiz_char_total + 1)); + } m_light_pen_latched = false; -- cgit v1.2.3