diff options
author | 2019-03-26 11:13:37 +1100 | |
---|---|---|
committer | 2019-03-26 11:13:37 +1100 | |
commit | 97b67170277437131adf6ed4d60139c172529e4f (patch) | |
tree | 7a5cbf608f191075f1612b1af15832c206a3fe2d /src/lib/netlist/analog/nld_switches.cpp | |
parent | b380514764cf857469bae61c11143a19f79a74c5 (diff) |
(nw) Clean up the mess on master
This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and
c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at
598cd5227223c3b04ca31f0dbc1981256d9ea3ff.
Before pushing, please check that what you're about to push is sane.
Check your local commit log and ensure there isn't anything out-of-place
before pushing to mainline. When things like this happen, it wastes
everyone's time. I really don't need this in a week when real work⢠is
busting my balls and I'm behind where I want to be with preparing for
MAME release.
Diffstat (limited to 'src/lib/netlist/analog/nld_switches.cpp')
-rw-r--r-- | src/lib/netlist/analog/nld_switches.cpp | 49 |
1 files changed, 32 insertions, 17 deletions
diff --git a/src/lib/netlist/analog/nld_switches.cpp b/src/lib/netlist/analog/nld_switches.cpp index 1575551f260..0e62fe13952 100644 --- a/src/lib/netlist/analog/nld_switches.cpp +++ b/src/lib/netlist/analog/nld_switches.cpp @@ -6,10 +6,13 @@ */ #include "nlid_twoterm.h" -#include "../nl_base.h" -#include "../nl_factory.h" +#include "netlist/nl_base.h" +#include "netlist/nl_factory.h" +#include "netlist/solver/nld_solver.h" -#define R_OFF (1.0 / netlist().gmin()) +/* FIXME : convert to parameters */ + +#define R_OFF (1.0 / exec().gmin()) #define R_ON 0.01 namespace netlist @@ -24,7 +27,7 @@ namespace netlist { NETLIB_CONSTRUCTOR(switch1) , m_R(*this, "R") - , m_POS(*this, "POS", 0) + , m_POS(*this, "POS", false) { register_subalias("1", m_R.m_P); register_subalias("2", m_R.m_N); @@ -46,6 +49,11 @@ namespace netlist NETLIB_UPDATE(switch1) { + } + + NETLIB_UPDATE_PARAM(switch1) + { + m_R.solve_now(); if (!m_POS()) { m_R.set_R(R_OFF); @@ -54,13 +62,8 @@ namespace netlist { m_R.set_R(R_ON); } + m_R.solve_later(); - m_R.update_dev(); - } - - NETLIB_UPDATE_PARAM(switch1) - { - update(); } // ---------------------------------------------------------------------------------------- @@ -72,7 +75,7 @@ namespace netlist NETLIB_CONSTRUCTOR(switch2) , m_R1(*this, "R1") , m_R2(*this, "R2") - , m_POS(*this, "POS", 0) + , m_POS(*this, "POS", false) { connect(m_R1.m_N, m_R2.m_N); @@ -110,19 +113,31 @@ namespace netlist m_R2.set_R(R_ON); } - m_R1.update_dev(); - m_R2.update_dev(); + //m_R1.update_dev(time); + //m_R2.update_dev(time); } NETLIB_UPDATE_PARAM(switch2) { - update(); + if (!m_POS()) + { + m_R1.set_R(R_ON); + m_R2.set_R(R_OFF); + } + else + { + m_R1.set_R(R_OFF); + m_R2.set_R(R_ON); + } + + m_R1.solve_now(); + m_R2.solve_now(); } } //namespace analog namespace devices { - NETLIB_DEVICE_IMPL_NS(analog, switch1) - NETLIB_DEVICE_IMPL_NS(analog, switch2) - } + NETLIB_DEVICE_IMPL_NS(analog, switch1, "SWITCH", "") + NETLIB_DEVICE_IMPL_NS(analog, switch2, "SWITCH2", "") + } // namespace devices } // namespace netlist |