diff options
author | couriersud <couriersud@gmx.org> | 2019-11-16 18:06:47 +0100 |
---|---|---|
committer | couriersud <couriersud@gmx.org> | 2019-11-16 18:06:47 +0100 |
commit | ba8da7aae7cd383998f3210932b721646a8874a2 (patch) | |
tree | 6e16e28e1c6d4c748588966eb31fb3bd7f7bc9f3 /src/devices/video | |
parent | 7880de4d3252e1b6cae07363d8d5f0f8d8a8c2cb (diff) |
netlist: Fix freeze on reset (F3). (nw)
Also added a link to pong video showing a real pcb.
Diffstat (limited to 'src/devices/video')
-rw-r--r-- | src/devices/video/fixfreq.cpp | 4 | ||||
-rw-r--r-- | src/devices/video/fixfreq.h | 27 |
2 files changed, 23 insertions, 8 deletions
diff --git a/src/devices/video/fixfreq.cpp b/src/devices/video/fixfreq.cpp index 615fe4ce0cf..c5dc2e5ffcb 100644 --- a/src/devices/video/fixfreq.cpp +++ b/src/devices/video/fixfreq.cpp @@ -19,6 +19,8 @@ //#define VERBOSE 1 #include "logmacro.h" +#include <algorithm> + /*************************************************************************** Fixed frequency monitor @@ -46,7 +48,7 @@ void fixedfreq_monitor_state::update_sync_channel(const time_type &time, const d { //LOG("VSYNC %d %d\n", m_last_x, m_last_y + m_sig_field); m_last_y = m_desc.m_vbackporch - m_desc.m_vsync; - m_intf.vsync_start_cb(time - m_last_vsync_time); + m_intf.vsync_start_cb(std::max(time - m_last_vsync_time, m_min_frame_period)); m_last_vsync_time = time; } else if (last_vsync && !m_sig_vsync) diff --git a/src/devices/video/fixfreq.h b/src/devices/video/fixfreq.h index d85056d874b..6e758ec4ffa 100644 --- a/src/devices/video/fixfreq.h +++ b/src/devices/video/fixfreq.h @@ -84,7 +84,8 @@ struct fixedfreq_monitor_state m_vsync_filter_timeconst(0), m_sig_vsync(0), m_sig_composite(0), - m_sig_field(0) + m_sig_field(0), + m_min_frame_period(time_type(0)) {} /*** @@ -124,17 +125,29 @@ struct fixedfreq_monitor_state //LOG("trigger %f with len %f\n", m_vsync_threshold, 1e6 / m_vsync_filter_timeconst); m_clock_period = 1.0 / m_desc.m_monitor_clock; - m_intf.vsync_start_cb(m_clock_period * m_desc.m_vbackporch * m_desc.m_hbackporch); + // Minimum frame period to be passed to video system ? + m_min_frame_period = 0.25 * m_clock_period * m_desc.m_vbackporch * m_desc.m_hbackporch; + m_intf.vsync_start_cb(m_min_frame_period); } void reset() { - m_last_sync_time = time_type(0); - m_line_time = time_type(0); - m_last_hsync_time = time_type(0); - m_last_vsync_time = time_type(0); + m_sync_signal = 0; + m_col = 0; + m_last_x = 0; + m_last_y = 0; + //m_last_sync_time = time_type(0); + //m_line_time = time_type(0); + //m_last_hsync_time = time_type(0); + //m_last_vsync_time = time_type(0); + //m_clock_period = time_type(0); m_vsync_filter = 0; + //m_vsync_threshold = 0; + //m_vsync_filter_timeconst = 0; + m_sig_vsync = 0; + m_sig_composite = 0; + m_sig_field = 0; } void update_sync_channel(const time_type &time, const double newval); @@ -166,7 +179,7 @@ struct fixedfreq_monitor_state int m_sig_vsync; int m_sig_composite; int m_sig_field; - + time_type m_min_frame_period; }; // ======================> fixedfreq_device |