summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2019-04-13 18:28:17 +0200
committer couriersud <couriersud@gmx.org>2019-04-13 18:30:28 +0200
commitd1602bd9f17e8ba6983252feed484bd1a16b7b57 (patch)
tree103390b84d5155e66cecfbfa5d7dc5cf6ccb8ec5
parent858d84c4bc16aa89f1352399edc87dc63464b0dd (diff)
netlist: bug fixing.
- fix sound route dependency - add "K" as a valid Kilo multiplier. - Fix current source parameter update.
-rw-r--r--src/devices/machine/netlist.cpp10
-rw-r--r--src/devices/machine/netlist.h2
-rw-r--r--src/lib/netlist/analog/nlid_twoterm.cpp16
-rw-r--r--src/lib/netlist/analog/nlid_twoterm.h21
-rw-r--r--src/lib/netlist/nl_setup.cpp1
5 files changed, 32 insertions, 18 deletions
diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp
index 3e7580be5b9..83e5fd295b3 100644
--- a/src/devices/machine/netlist.cpp
+++ b/src/devices/machine/netlist.cpp
@@ -467,6 +467,8 @@ private:
netlist::setup_t &netlist_mame_device::setup()
{
+ if (!m_netlist)
+ throw device_missing_dependencies();
return m_netlist->nlstate().setup();
}
@@ -548,6 +550,14 @@ void netlist_mame_sub_interface::set_mult_offset(const double mult, const double
m_offset = offset;
}
+netlist_mame_analog_input_device::netlist_mame_analog_input_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *param_name)
+ : device_t(mconfig, NETLIST_ANALOG_INPUT, tag, owner, 0)
+ , netlist_mame_sub_interface(*owner)
+ , m_param(nullptr)
+ , m_auto_port(true)
+ , m_param_name(param_name)
+{
+}
netlist_mame_analog_input_device::netlist_mame_analog_input_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, NETLIST_ANALOG_INPUT, tag, owner, clock)
diff --git a/src/devices/machine/netlist.h b/src/devices/machine/netlist.h
index 639223d2842..b5844eed057 100644
--- a/src/devices/machine/netlist.h
+++ b/src/devices/machine/netlist.h
@@ -300,6 +300,8 @@ class netlist_mame_analog_input_device : public device_t, public netlist_mame_su
public:
// construction/destruction
+ netlist_mame_analog_input_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *param_name);
+
netlist_mame_analog_input_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
void set_name(const char *param_name) { m_param_name = param_name; }
diff --git a/src/lib/netlist/analog/nlid_twoterm.cpp b/src/lib/netlist/analog/nlid_twoterm.cpp
index 5019c98c0e4..aaddb65387a 100644
--- a/src/lib/netlist/analog/nlid_twoterm.cpp
+++ b/src/lib/netlist/analog/nlid_twoterm.cpp
@@ -57,22 +57,6 @@ NETLIB_RESET(R_base)
}
// ----------------------------------------------------------------------------------------
-// nld_R
-// ----------------------------------------------------------------------------------------
-
-NETLIB_UPDATE_PARAM(R)
-{
- solve_now();
- set_R(std::max(m_R(), exec().gmin()));
-}
-
-NETLIB_RESET(R)
-{
- NETLIB_NAME(twoterm)::reset();
- set_R(std::max(m_R(), exec().gmin()));
-}
-
-// ----------------------------------------------------------------------------------------
// nld_POT
// ----------------------------------------------------------------------------------------
diff --git a/src/lib/netlist/analog/nlid_twoterm.h b/src/lib/netlist/analog/nlid_twoterm.h
index 332c3af8900..1dc639008c4 100644
--- a/src/lib/netlist/analog/nlid_twoterm.h
+++ b/src/lib/netlist/analog/nlid_twoterm.h
@@ -149,9 +149,18 @@ namespace analog
protected:
- NETLIB_RESETI();
//NETLIB_UPDATEI() { }
- NETLIB_UPDATE_PARAMI();
+ NETLIB_RESETI()
+ {
+ NETLIB_NAME(twoterm)::reset();
+ set_R(std::max(m_R(), exec().gmin()));
+ }
+
+ NETLIB_UPDATE_PARAMI()
+ {
+ solve_now();
+ set_R(std::max(m_R(), exec().gmin()));
+ }
private:
param_double_t m_R;
@@ -465,6 +474,14 @@ namespace analog
0.0, 0.0, m_I());
}
+ NETLIB_UPDATE_PARAMI()
+ {
+ solve_now();
+ set_mat(0.0, 0.0, -m_I(),
+ 0.0, 0.0, m_I());
+ }
+
+
private:
state_var<double> m_t;
param_double_t m_I;
diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp
index 14806451947..7fa3db867a9 100644
--- a/src/lib/netlist/nl_setup.cpp
+++ b/src/lib/netlist/nl_setup.cpp
@@ -912,6 +912,7 @@ nl_double models_t::value(pstring model, pstring entity)
{
case 'M': factor = 1e6; break;
case 'k': factor = 1e3; break;
+ case 'K': factor = 1e3; break;
case 'm': factor = 1e-3; break;
case 'u': factor = 1e-6; break;
case 'n': factor = 1e-9; break;