diff --git a/src/emu/video/fixfreq.c b/src/emu/video/fixfreq.c index f43d77c5c51..0f1808b548a 100644 --- a/src/emu/video/fixfreq.c +++ b/src/emu/video/fixfreq.c @@ -45,7 +45,8 @@ fixedfreq_device::fixedfreq_device(const machine_config &mconfig, device_type ty m_vsync(492), m_vbackporch(525), m_fieldcount(2), - m_sync_threshold(0.3) + m_sync_threshold(0.3), + m_gain(1.0 / 3.7) { } @@ -63,7 +64,8 @@ fixedfreq_device::fixedfreq_device(const machine_config &mconfig, const char *ta m_vsync(492), m_vbackporch(525), m_fieldcount(2), - m_sync_threshold(0.3) + m_sync_threshold(0.3), + m_gain(1.0 / 3.7) { } @@ -247,10 +249,11 @@ NETDEV_ANALOG_CALLBACK_MEMBER(fixedfreq_device::update_vid) rgb_t col; if (m_vid < m_sync_threshold) + // Mark sync areas col = rgb_t(255, 0, 0); else { - int colv = (int) ((m_vid - m_sync_threshold) / 3.7 * 255.0); + int colv = (int) ((m_vid - m_sync_threshold) * m_gain * 255.0); if (colv > 255) colv = 255; col = rgb_t(colv, colv, colv); @@ -272,6 +275,7 @@ NETDEV_ANALOG_CALLBACK_MEMBER(fixedfreq_device::update_vid) if (sync & 2) { VERBOSE_OUT(("HSYNC up %d\n", pixels)); + //if (m_last_y == 27) printf("HSYNC up %d %d\n", m_last_y, pixels); } if (sync & 4) { @@ -287,7 +291,8 @@ NETDEV_ANALOG_CALLBACK_MEMBER(fixedfreq_device::update_vid) m_last_vsync_time = time; } - if ((sync & 2) && !m_sig_vsync) + // FIXME: pixels > 50 filters some spurious hysnc on line 27 in breakout + if ((sync & 2) && !m_sig_vsync && (pixels > 50)) { m_last_y += m_fieldcount; m_last_x = 0; diff --git a/src/emu/video/fixfreq.h b/src/emu/video/fixfreq.h index fa9703cd2b4..37fef7871bb 100644 --- a/src/emu/video/fixfreq.h +++ b/src/emu/video/fixfreq.h @@ -40,6 +40,9 @@ #define MCFG_FIXFREQ_SYNC_THRESHOLD(_threshold) \ fixedfreq_device::set_threshold(*device, _threshold); +#define MCFG_FIXFREQ_GAIN(_gain) \ + fixedfreq_device::set_gain(*device, _gain); + // pre-defined configurations //ModeLine "720x480@30i" 13.5 720 736 799 858 480 486 492 525 interlace -hsync -vsync @@ -73,6 +76,7 @@ public: static void set_minitor_clock(device_t &device, UINT32 clock) { downcast(device).m_monitor_clock = clock; } static void set_fieldcount(device_t &device, int count) { downcast(device).m_fieldcount = count; } static void set_threshold(device_t &device, double threshold) { downcast(device).m_sync_threshold = threshold; } + static void set_gain(device_t &device, double gain) { downcast(device).m_gain = gain; } static void set_horz_params(device_t &device, int visible, int frontporch, int sync, int backporch) { fixedfreq_device &dev = downcast(device); @@ -135,6 +139,7 @@ private: int m_vbackporch; int m_fieldcount; double m_sync_threshold; + double m_gain; /* sync separator */ double m_vint;