diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2017-06-12 22:48:46 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2017-06-12 22:48:46 -0400 |
commit | 771dcf836aea5a3a7e8db3c1804b27f727c58495 (patch) | |
tree | 03e768379b047d2c801bcb5e69e331b2dc7bfb2d | |
parent | 56bd27a963ff82dfdedfb00da83b4ebc8491c607 (diff) |
74157: Prevent unnecessary reads (nw)
-rw-r--r-- | src/devices/machine/74157.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/devices/machine/74157.cpp b/src/devices/machine/74157.cpp index 863861ef94f..2151775e5d8 100644 --- a/src/devices/machine/74157.cpp +++ b/src/devices/machine/74157.cpp @@ -54,7 +54,7 @@ void ls157_device::device_start() // resolve callbacks m_a_in_cb.resolve(); m_b_in_cb.resolve(); - m_out_cb.resolve_safe(); + m_out_cb.resolve(); // register items for save state save_item(NAME(m_a)); @@ -178,7 +178,7 @@ void ls157_device::write_a_bit(int bit, bool state) else m_a &= ~(1 << bit); - if (!m_strobe && !m_select) + if (!m_strobe && !m_select && !m_out_cb.isnull()) m_out_cb(m_a); } } @@ -202,7 +202,7 @@ void ls157_device::write_b_bit(int bit, bool state) else m_b &= ~(1 << bit); - if (!m_strobe && m_select) + if (!m_strobe && m_select && !m_out_cb.isnull()) m_out_cb(m_b); } } @@ -237,7 +237,7 @@ WRITE_LINE_MEMBER(ls157_device::strobe_w) m_strobe = bool(state); // Clear output when strobe goes high - if (m_strobe) + if (m_strobe && !m_out_cb.isnull()) m_out_cb(0); else update_output(); @@ -254,7 +254,7 @@ void ls157_device::update_output() { // S high, strobe low: Y1-Y4 = B1-B4 // S low, strobe low: Y1-Y4 = A1-A4 - if (!m_strobe) + if (!m_strobe && !m_out_cb.isnull()) { if (m_select) m_out_cb(m_b_in_cb.isnull() ? m_b : (m_b_in_cb() & 0xf)); |