diff options
Diffstat (limited to 'src/lib/netlist/devices/nld_7492.cpp')
-rw-r--r-- | src/lib/netlist/devices/nld_7492.cpp | 69 |
1 files changed, 31 insertions, 38 deletions
diff --git a/src/lib/netlist/devices/nld_7492.cpp b/src/lib/netlist/devices/nld_7492.cpp index 603daf21588..39dce8217eb 100644 --- a/src/lib/netlist/devices/nld_7492.cpp +++ b/src/lib/netlist/devices/nld_7492.cpp @@ -37,7 +37,37 @@ namespace devices } private: - NETLIB_UPDATEI(); + NETLIB_UPDATEI() + { + const netlist_sig_t new_A = m_A(); + const netlist_sig_t new_B = m_B(); + + if (m_R1() & m_R2()) + { + m_cnt = 0; + m_Q.push(0, delay); + } + else + { + if (m_last_A && !new_A) // High - Low + { + m_cnt ^= 1; + m_Q[0].push(m_cnt & 1, delay[0]); + } + if (m_last_B && !new_B) // High - Low + { + m_cnt += 2; + if (m_cnt == 6) + m_cnt = 8; + if (m_cnt == 14) + m_cnt = 0; + m_Q.push(m_cnt, delay); + } + } + m_last_A = new_A; + m_last_B = new_B; + } + NETLIB_RESETI() { m_cnt = 0; @@ -45,12 +75,6 @@ namespace devices m_last_B = 0; } - void update_outputs() noexcept - { - for (std::size_t i=0; i<4; i++) - m_Q[i].push((m_cnt >> i) & 1, delay[i]); - } - logic_input_t m_A; logic_input_t m_B; logic_input_t m_R1; @@ -92,37 +116,6 @@ namespace devices NETLIB_SUB(7492) A; }; - NETLIB_UPDATE(7492) - { - const netlist_sig_t new_A = m_A(); - const netlist_sig_t new_B = m_B(); - - if (m_R1() & m_R2()) - { - m_cnt = 0; - update_outputs(); - } - else - { - if (m_last_A && !new_A) // High - Low - { - m_cnt ^= 1; - m_Q[0].push(m_cnt & 1, delay[0]); - } - if (m_last_B && !new_B) // High - Low - { - m_cnt += 2; - if (m_cnt == 6) - m_cnt = 8; - if (m_cnt == 14) - m_cnt = 0; - update_outputs(); - } - } - m_last_A = new_A; - m_last_B = new_B; - } - NETLIB_DEVICE_IMPL(7492, "TTL_7492", "+A,+B,+R1,+R2,@VCC,@GND") NETLIB_DEVICE_IMPL(7492_dip, "TTL_7492_DIP", "") |