diff options
Diffstat (limited to 'src/lib/netlist/devices/nld_7483.cpp')
-rw-r--r-- | src/lib/netlist/devices/nld_7483.cpp | 47 |
1 files changed, 16 insertions, 31 deletions
diff --git a/src/lib/netlist/devices/nld_7483.cpp b/src/lib/netlist/devices/nld_7483.cpp index 5f820162209..72c86c003d5 100644 --- a/src/lib/netlist/devices/nld_7483.cpp +++ b/src/lib/netlist/devices/nld_7483.cpp @@ -6,7 +6,7 @@ */ #include "nld_7483.h" -#include "netlist/nl_base.h" +#include "../nl_base.h" namespace netlist { @@ -16,16 +16,14 @@ namespace netlist { NETLIB_CONSTRUCTOR(7483) , m_C0(*this, "C0") - , m_A1(*this, "A1", NETLIB_DELEGATE(7483, upd_a)) - , m_A2(*this, "A2", NETLIB_DELEGATE(7483, upd_a)) - , m_A3(*this, "A3", NETLIB_DELEGATE(7483, upd_a)) - , m_A4(*this, "A4", NETLIB_DELEGATE(7483, upd_a)) - , m_B1(*this, "B1", NETLIB_DELEGATE(7483, upd_b)) - , m_B2(*this, "B2", NETLIB_DELEGATE(7483, upd_b)) - , m_B3(*this, "B3", NETLIB_DELEGATE(7483, upd_b)) - , m_B4(*this, "B4", NETLIB_DELEGATE(7483, upd_b)) - , m_a(*this, "m_a", 0) - , m_b(*this, "m_b", 0) + , m_A1(*this, "A1") + , m_A2(*this, "A2") + , m_A3(*this, "A3") + , m_A4(*this, "A4") + , m_B1(*this, "B1") + , m_B2(*this, "B2") + , m_B3(*this, "B3") + , m_B4(*this, "B4") , m_lastr(*this, "m_lastr", 0) , m_S1(*this, "S1") , m_S2(*this, "S2") @@ -36,8 +34,6 @@ namespace netlist } NETLIB_RESETI(); NETLIB_UPDATEI(); - NETLIB_HANDLERI(upd_a); - NETLIB_HANDLERI(upd_b); protected: logic_input_t m_C0; @@ -50,9 +46,7 @@ namespace netlist logic_input_t m_B3; logic_input_t m_B4; - state_var_u8 m_a; - state_var_u8 m_b; - state_var_u8 m_lastr; + state_var<unsigned> m_lastr; logic_output_t m_S1; logic_output_t m_S2; @@ -93,21 +87,12 @@ namespace netlist m_lastr = 0; } - NETLIB_HANDLER(7483, upd_a) - { - m_a = static_cast<uint8_t>((m_A1() << 0) | (m_A2() << 1) | (m_A3() << 2) | (m_A4() << 3)); - NETLIB_NAME(7483)::update(); - } - - NETLIB_HANDLER(7483, upd_b) - { - m_b = static_cast<uint8_t>((m_B1() << 0) | (m_B2() << 1) | (m_B3() << 2) | (m_B4() << 3)); - NETLIB_NAME(7483)::update(); - } - NETLIB_UPDATE(7483) { - auto r = static_cast<uint8_t>(m_a + m_b + m_C0()); + netlist_sig_t a = (m_A1() << 0) | (m_A2() << 1) | (m_A3() << 2) | (m_A4() << 3); + netlist_sig_t b = (m_B1() << 0) | (m_B2() << 1) | (m_B3() << 2) | (m_B4() << 3); + + unsigned r = a + b + m_C0(); if (r != m_lastr) { @@ -120,8 +105,8 @@ namespace netlist } } - NETLIB_DEVICE_IMPL(7483, "TTL_7483", "+A1,+A2,+A3,+A4,+B1,+B2,+B3,+B4,+C0") - NETLIB_DEVICE_IMPL(7483_dip, "TTL_7483_DIP", "") + NETLIB_DEVICE_IMPL(7483) + NETLIB_DEVICE_IMPL(7483_dip) } //namespace devices } // namespace netlist |