diff options
Diffstat (limited to 'src/devices/video/hlcd0488.cpp')
-rw-r--r-- | src/devices/video/hlcd0488.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/devices/video/hlcd0488.cpp b/src/devices/video/hlcd0488.cpp index beed0221a3f..293f9e96a07 100644 --- a/src/devices/video/hlcd0488.cpp +++ b/src/devices/video/hlcd0488.cpp @@ -12,7 +12,7 @@ TODO: */ #include "emu.h" -#include "video/hlcd0488.h" +#include "hlcd0488.h" DEFINE_DEVICE_TYPE(HLCD0488, hlcd0488_device, "hlcd0488", "Hughes HLCD 0488 LCD Driver") @@ -24,10 +24,7 @@ DEFINE_DEVICE_TYPE(HLCD0488, hlcd0488_device, "hlcd0488", "Hughes HLCD 0488 LCD hlcd0488_device::hlcd0488_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, HLCD0488, tag, owner, clock), m_write_cols(*this) -{ - memset(m_latch, 0, 8); - memset(m_hold, 0, 8); -} +{ } //------------------------------------------------- @@ -36,8 +33,17 @@ hlcd0488_device::hlcd0488_device(const machine_config &mconfig, const char *tag, void hlcd0488_device::device_start() { - m_write_cols.resolve_safe(); - m_sync_timer = timer_alloc(); + m_sync_timer = timer_alloc(FUNC(hlcd0488_device::sync_update), this); + + // zerofill + m_latch_pulse = 0; + m_latch_pulse_prev = 0; + m_data_clk = 0; + m_data_clk_prev = 0; + m_data = 0; + m_count = 0; + std::fill_n(m_latch, std::size(m_latch), 0); + std::fill_n(m_hold, std::size(m_hold), 0); // register for savestates save_item(NAME(m_latch_pulse)); @@ -55,7 +61,7 @@ void hlcd0488_device::device_start() // handlers //------------------------------------------------- -void hlcd0488_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +TIMER_CALLBACK_MEMBER(hlcd0488_device::sync_update) { // Latch pulse, when high, resets the %8 latch address counter if (m_latch_pulse) @@ -85,13 +91,13 @@ void hlcd0488_device::device_timer(emu_timer &timer, device_timer_id id, int par m_data_clk_prev = m_data_clk; } -WRITE_LINE_MEMBER(hlcd0488_device::latch_pulse_w) +void hlcd0488_device::latch_pulse_w(int state) { m_latch_pulse = state ? 1 : 0; m_sync_timer->adjust(attotime::zero); } -WRITE_LINE_MEMBER(hlcd0488_device::data_clk_w) +void hlcd0488_device::data_clk_w(int state) { m_data_clk = state ? 1 : 0; m_sync_timer->adjust(attotime::zero); |