diff options
author | 2019-01-04 19:19:25 +0100 | |
---|---|---|
committer | 2019-01-04 19:19:25 +0100 | |
commit | 880786341d76ce39147bc557387714ae1eb79f9f (patch) | |
tree | 92a3514f28e71799532e632838d1ee427aa19ae0 | |
parent | ee115932f8f2106588a06cd43b51d329ddef6ef1 (diff) |
Implement sub-pixel horizontal resolution. (nw)
This is not yet used and missing static initialization interface.
Electron beams in CRTs are not discrete. They are continous on a
scanline. This modification allows a higher horizontal resolution to
better model "subpixel" timing.
-rw-r--r-- | src/devices/video/fixfreq.cpp | 23 | ||||
-rw-r--r-- | src/devices/video/fixfreq.h | 1 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/devices/video/fixfreq.cpp b/src/devices/video/fixfreq.cpp index d0c2e2b4a5d..b548e7cd3d9 100644 --- a/src/devices/video/fixfreq.cpp +++ b/src/devices/video/fixfreq.cpp @@ -19,7 +19,6 @@ //#define VERBOSE 1 #include "logmacro.h" - /*************************************************************************** Fixed frequency monitor @@ -31,7 +30,13 @@ DEFINE_DEVICE_TYPE(FIXFREQ, fixedfreq_device, "fixfreq", "Fixed-Frequency Monoch fixedfreq_device::fixedfreq_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_htotal(0), m_vtotal(0), m_sync_signal(0), m_last_x(0), m_last_y(0), m_cur_bm(0), + m_htotal(0), + m_vtotal(0), + m_hscale(1), // FIXME: this should be modified by static initialization + m_sync_signal(0), + m_last_x(0), + m_last_y(0), + m_cur_bm(0), // default to NTSC "704x480@30i" m_monitor_clock(13500000), m_hvisible(704), @@ -146,8 +151,8 @@ void fixedfreq_device::recompute_parameters() m_vsync_filter_timeconst = (double) (m_monitor_clock) / (double) m_htotal * 1.0; // / (3.0 + 3.0); LOG("trigger %f with len %f\n", m_vsync_threshold, 1e6 / m_vsync_filter_timeconst); - m_bitmap[0] = std::make_unique<bitmap_rgb32>(m_htotal, m_vtotal); - m_bitmap[1] = std::make_unique<bitmap_rgb32>(m_htotal, m_vtotal); + m_bitmap[0] = std::make_unique<bitmap_rgb32>(m_htotal * m_hscale, m_vtotal); + m_bitmap[1] = std::make_unique<bitmap_rgb32>(m_htotal * m_hscale, m_vtotal); m_clock_period = 1.0 / m_monitor_clock; update_screen_parameters(m_clock_period * m_vtotal * m_htotal); @@ -156,13 +161,13 @@ void fixedfreq_device::recompute_parameters() void fixedfreq_device::update_screen_parameters(const time_type &refresh) { rectangle visarea( - m_hbackporch - m_hfrontporch, - m_hbackporch - m_hfrontporch + m_hvisible - 1, + (m_hbackporch - m_hfrontporch) * m_hscale, + (m_hbackporch - m_hfrontporch + m_hvisible) * m_hscale - 1, m_vbackporch - m_vfrontporch, m_vbackporch - m_vfrontporch + m_vvisible - 1); m_refresh_period = refresh; - screen().configure(m_htotal, m_vtotal, visarea, DOUBLE_TO_ATTOSECONDS(m_refresh_period)); + screen().configure(m_htotal * m_hscale, m_vtotal, visarea, DOUBLE_TO_ATTOSECONDS(m_refresh_period)); } void fixedfreq_device::update_sync_channel(const time_type &time, const double newval) @@ -198,7 +203,7 @@ void fixedfreq_device::update_sync_channel(const time_type &time, const double n /* TODO - time since last hsync and field detection */ LOG("HSYNC up %d\n", m_last_x); // FIXME: pixels > 50 filters some spurious hysnc on line 27 in breakout - if (!m_sig_vsync && (m_last_x > 100)) + if (!m_sig_vsync && (m_last_x > m_hscale * 100)) { m_last_y += m_fieldcount; m_last_x = 0; @@ -218,7 +223,7 @@ void fixedfreq_device::update_sync_channel(const time_type &time, const double n void fixedfreq_device::update_bm(const time_type &time) { - const int pixels = round((time - m_line_time) / m_clock_period); + const int pixels = round((time - m_line_time) * m_hscale / m_clock_period); const int has_fields = (m_fieldcount > 1) ? 1: 0; bitmap_rgb32 *bm = m_bitmap[m_cur_bm].get(); diff --git a/src/devices/video/fixfreq.h b/src/devices/video/fixfreq.h index d6c5424a027..b6db82f1ae9 100644 --- a/src/devices/video/fixfreq.h +++ b/src/devices/video/fixfreq.h @@ -124,6 +124,7 @@ private: int m_htotal; int m_vtotal; + int m_hscale; double m_sync_signal; rgb_t m_col; |