From 062545017f5e1527b5a8ec52654432f682396f51 Mon Sep 17 00:00:00 2001 From: Couriersud Date: Wed, 18 Dec 2013 13:10:33 +0000 Subject: [PATCH] Fixfreq: Don't process hsyncs while we are vsyncing. Fixes video jitter/jumps. --- src/emu/video/fixfreq.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/emu/video/fixfreq.c b/src/emu/video/fixfreq.c index 2254fedfd65..a272ad9cf14 100644 --- a/src/emu/video/fixfreq.c +++ b/src/emu/video/fixfreq.c @@ -145,7 +145,7 @@ void fixedfreq_device::recompute_parameters(bool postload) /* sync separator */ m_int_trig = (exp(- 3.0/(3.0+3.0))) - exp(-1.0); - m_mult = (double) (m_monitor_clock) / m_htotal; // / (3.0 + 3.0); + m_mult = (double) (m_monitor_clock) / (double) m_htotal * 1.0; // / (3.0 + 3.0); VERBOSE_OUT(("trigger %f with len %f\n", m_int_trig, 1e6 / m_mult)); m_bitmap[0] = auto_bitmap_rgb32_alloc(machine(),m_htotal, m_vtotal); @@ -183,8 +183,8 @@ int fixedfreq_device::sync_separator(attotime time, double newval) int last_comp = m_sig_composite; int ret = 0; - m_vint += ((double) m_sig_composite - m_vint) * (1.0 - exp(-time.as_double() * m_mult)); - m_sig_composite = (newval < m_sync_threshold) ? 1 : 0 ; + m_vint += ((double) last_comp - m_vint) * (1.0 - exp(-time.as_double() * m_mult)); + m_sig_composite = (newval < m_sync_threshold) ? 1 : 0 ; m_sig_vsync = (m_vint > m_int_trig) ? 1 : 0; @@ -234,6 +234,7 @@ void fixedfreq_device::update_vid(double newval, attotime cur_time) if (m_last_y < bm->height()) { rgb_t col; + if (m_vid < m_sync_threshold) col = MAKE_RGB(255, 0, 0); else @@ -242,8 +243,6 @@ void fixedfreq_device::update_vid(double newval, attotime cur_time) col = MAKE_RGB(colv, colv, colv); } - if (m_vid < m_sync_threshold) - while (0 && pixels >= m_htotal) { bm->plot_box(m_last_x, m_last_y + m_sig_field, m_htotal - 1 - m_last_x, 1, col); @@ -265,7 +264,6 @@ void fixedfreq_device::update_vid(double newval, attotime cur_time) { VERBOSE_OUT(("HSYNC down %f %d %f\n", time.as_double()* 1e6, pixels, m_vid)); } - //VERBOSE_OUT(("%d\n", m_last_x); if (sync & 1) { @@ -276,7 +274,7 @@ void fixedfreq_device::update_vid(double newval, attotime cur_time) m_last_vsync_time = cur_time; } - if (sync & 2) + if ((sync & 2) && !m_sig_vsync) { m_last_y += m_fieldcount; m_last_x = 0;