diff options
Diffstat (limited to 'src/lib/netlist/nl_base.cpp')
-rw-r--r-- | src/lib/netlist/nl_base.cpp | 59 |
1 files changed, 35 insertions, 24 deletions
diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index a786c879286..709e41f96f9 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -892,38 +892,16 @@ param_t::param_t(const param_type_t atype, device_t &device, const pstring &name : device_object_t(device, device.name() + "." + name, PARAM) , m_param_type(atype) { + device.setup().register_param(this->name(), *this); } -void param_t::register_and_set() +void param_t::update_param() { - dynamic_cast<device_t &>(device()).setup().register_and_set_param(this->name(), *this); -} - -void param_t::changed_and_update() -{ - changed(); device().update_param(); if (device().needs_update_after_param_change()) device().update_dev(); } -template <typename C, param_t::param_type_t T> -param_template_t<C, T>::param_template_t(device_t &device, const pstring name, const C val) -: param_t(T, device, name) -, m_param(val) -{ - /* pstrings not yet supported, these need special logic */ - if (T != param_t::STRING && T != param_t::MODEL) - netlist().save(*this, m_param, "m_param"); -} - -template class param_template_t<double, param_t::DOUBLE>; -template class param_template_t<int, param_t::INTEGER>; -template class param_template_t<bool, param_t::LOGIC>; -template class param_template_t<std::uint_fast8_t*, param_t::POINTER>; -template class param_template_t<pstring, param_t::STRING>; -//template class param_template_t<pstring, param_t::MODEL>; - const pstring param_model_t::model_type() { if (m_map.size() == 0) @@ -931,6 +909,39 @@ const pstring param_model_t::model_type() return m_map["COREMODEL"]; } +param_str_t::param_str_t(device_t &device, const pstring name, const pstring val) +: param_t(param_t::STRING, device, name) +{ + m_param = device.setup().get_initial_param_val(this->name(),val); +} + +param_double_t::param_double_t(device_t &device, const pstring name, const double val) +: param_t(param_t::DOUBLE, device, name) +{ + m_param = device.setup().get_initial_param_val(this->name(),val); + netlist().save(*this, m_param, "m_param"); +} + +param_int_t::param_int_t(device_t &device, const pstring name, const int val) +: param_t(param_t::INTEGER, device, name) +{ + m_param = device.setup().get_initial_param_val(this->name(),val); + netlist().save(*this, m_param, "m_param"); +} + +param_logic_t::param_logic_t(device_t &device, const pstring name, const bool val) +: param_t(param_t::LOGIC, device, name) +{ + m_param = device.setup().get_initial_param_val(this->name(),val); + netlist().save(*this, m_param, "m_param"); +} + +param_ptr_t::param_ptr_t(device_t &device, const pstring name, uint8_t * val) +: param_t(param_t::POINTER, device, name) +{ + m_param = val; //device.setup().get_initial_param_val(this->name(),val); + //netlist().save(*this, m_param, "m_param"); +} const pstring param_model_t::model_value_str(const pstring &entity) { |