diff options
Diffstat (limited to 'src/devices/video/dm9368.cpp')
-rw-r--r-- | src/devices/video/dm9368.cpp | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/src/devices/video/dm9368.cpp b/src/devices/video/dm9368.cpp index 4702430403b..eb94796670d 100644 --- a/src/devices/video/dm9368.cpp +++ b/src/devices/video/dm9368.cpp @@ -40,40 +40,55 @@ dm9368_device::dm9368_device(const machine_config &mconfig, const char *tag, dev device_t(mconfig, DM9368, tag, owner, clock), m_update_cb(*this), m_rbo_cb(*this), + m_a(0), m_rbi(1), m_rbo(1) { } +void dm9368_device::device_start() +{ + // state saving + save_item(NAME(m_a)); + save_item(NAME(m_rbi)); + save_item(NAME(m_rbo)); +} + + +// interface void dm9368_device::a_w(u8 data) { - int const a(data & 0x0f); - int const rbo((m_rbi || a) ? 1 : 0); - u8 const value(rbo ? s_segment_data[a] : 0); + data &= 0xf; + if (data != m_a) + { + m_a = data; + update(); + } +} + +void dm9368_device::rbi_w(int state) +{ + state = state ? 1 : 0; + if (state != m_rbi) + { + m_rbi = state; + update(); + } +} + +void dm9368_device::update() +{ + // RBI blanks the display only if A0-A3 is 0 + int const rbo((m_rbi || m_a) ? 1 : 0); + u8 const value(rbo ? s_segment_data[m_a] : 0); if (!rbo) LOG("DM9368 Blanked Rippling Zero\n"); else - LOG("DM9368 Output Data: %u = %02x\n", a, value); + LOG("DM9368 Output Data: %u = %02x\n", m_a, value); m_update_cb(0, value, 0x7f); if (rbo != m_rbo) m_rbo_cb(m_rbo = rbo); } - - -void dm9368_device::device_resolve_objects() -{ - // resolve callbacks - m_update_cb.resolve_safe(); - m_rbo_cb.resolve_safe(); -} - - -void dm9368_device::device_start() -{ - // state saving - save_item(NAME(m_rbi)); - save_item(NAME(m_rbo)); -} |