mirror of
https://github.com/holub/mame
synced 2025-04-21 07:52:35 +03:00
NET_C now accepts more than two terminals ...
This commit is contained in:
parent
da614b0b97
commit
34fc0756d7
@ -528,6 +528,20 @@ ATTR_COLD void netlist_net_t::init_object(netlist_base_t &nl, const pstring &ana
|
||||
nl.m_nets.add(this);
|
||||
}
|
||||
|
||||
ATTR_COLD void netlist_net_t::save_register()
|
||||
{
|
||||
save(NAME(m_last.Analog));
|
||||
save(NAME(m_cur.Analog));
|
||||
save(NAME(m_new.Analog));
|
||||
save(NAME(m_last.Q));
|
||||
save(NAME(m_cur.Q));
|
||||
save(NAME(m_new.Q));
|
||||
save(NAME(m_time));
|
||||
save(NAME(m_active));
|
||||
save(NAME(m_in_queue));
|
||||
netlist_object_t::save_register();
|
||||
}
|
||||
|
||||
ATTR_COLD void netlist_net_t::register_railterminal(netlist_output_t &mr)
|
||||
{
|
||||
assert(m_railterminal == NULL);
|
||||
@ -586,12 +600,12 @@ ATTR_HOT ATTR_ALIGN static void update_dev(const netlist_core_terminal_t *inp, c
|
||||
}
|
||||
}
|
||||
|
||||
ATTR_HOT ATTR_ALIGN void netlist_net_t::update_devs()
|
||||
ATTR_HOT /*ATTR_ALIGN*/ inline void netlist_net_t::update_devs()
|
||||
{
|
||||
assert(m_num_cons != 0);
|
||||
assert(this->isRailNet());
|
||||
|
||||
static const UINT32 masks[4] = { 1, 5, 3, 1 };
|
||||
const UINT32 masks[4] = { 1, 5, 3, 1 };
|
||||
const UINT32 mask = masks[ (m_last.Q << 1) | m_new.Q ];
|
||||
|
||||
m_in_queue = 2; /* mark as taken ... */
|
||||
|
@ -654,19 +654,7 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
ATTR_COLD virtual void save_register()
|
||||
{
|
||||
save(NAME(m_last.Analog));
|
||||
save(NAME(m_cur.Analog));
|
||||
save(NAME(m_new.Analog));
|
||||
save(NAME(m_last.Q));
|
||||
save(NAME(m_cur.Q));
|
||||
save(NAME(m_new.Q));
|
||||
save(NAME(m_time));
|
||||
save(NAME(m_active));
|
||||
save(NAME(m_in_queue));
|
||||
netlist_object_t::save_register();
|
||||
}
|
||||
ATTR_COLD virtual void save_register();
|
||||
ATTR_COLD virtual void reset();
|
||||
|
||||
|
||||
|
@ -379,15 +379,22 @@ void netlist_parser::net_alias()
|
||||
|
||||
void netlist_parser::net_c()
|
||||
{
|
||||
pstring t1 = get_identifier();
|
||||
pstring last = get_identifier();
|
||||
require_token(m_tok_comma);
|
||||
|
||||
require_token(m_tok_comma);
|
||||
pstring t2 = get_identifier();
|
||||
|
||||
require_token(m_tok_param_right);
|
||||
while (true)
|
||||
{
|
||||
pstring t1 = get_identifier();
|
||||
m_setup.register_link(last , t1);
|
||||
token_t n = get_token();
|
||||
if (n.is(m_tok_param_right))
|
||||
break;
|
||||
if (!n.is(m_tok_comma))
|
||||
error("expected a comma, found <%s>", n.str().cstr());
|
||||
last = t1;
|
||||
}
|
||||
|
||||
NL_VERBOSE_OUT(("Parser: Connect: %s %s\n", t1.cstr(), t2.cstr()));
|
||||
m_setup.register_link(t1 , t2);
|
||||
}
|
||||
|
||||
void netlist_parser::netdev_param()
|
||||
|
@ -267,6 +267,20 @@ void netlist_setup_t::register_object(netlist_device_t &dev, const pstring &name
|
||||
}
|
||||
}
|
||||
|
||||
void netlist_setup_t::register_link_arr(const pstring &terms)
|
||||
{
|
||||
nl_util::pstring_list list = nl_util::split(terms,", ");
|
||||
if (list.count() < 2)
|
||||
netlist().error("You must pass at least 2 terminals to NET_C");
|
||||
pstring last = list[0];
|
||||
for (int i = 1; i < list.count(); i++)
|
||||
{
|
||||
register_link(last, list[i]);
|
||||
last = list[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void netlist_setup_t::register_link(const pstring &sin, const pstring &sout)
|
||||
{
|
||||
link_t temp = link_t(build_fqn(sin), build_fqn(sout));
|
||||
|
@ -38,8 +38,14 @@
|
||||
#define NET_CONNECT(_name, _input, _output) \
|
||||
setup.register_link(# _name "." # _input, # _output);
|
||||
|
||||
#define NET_C(_input, _output) \
|
||||
setup.register_link(NET_STR(_input) , NET_STR(_output));
|
||||
#if 0
|
||||
#define NET_C(_term1, _term2, term...) \
|
||||
setup.register_link(NET_STR(_term1) , NET_STR(_term2));
|
||||
#endif
|
||||
|
||||
#define NET_C(_term1, _terms...) \
|
||||
setup.register_link_arr( #_term1 ", " # _terms);
|
||||
|
||||
|
||||
#define PARAM(_name, _val) \
|
||||
setup.register_param(# _name, _val);
|
||||
@ -123,6 +129,7 @@ public:
|
||||
void register_model(const pstring &model);
|
||||
void register_alias(const pstring &alias, const pstring &out);
|
||||
void register_alias_nofqn(const pstring &alias, const pstring &out);
|
||||
void register_link_arr(const pstring &terms);
|
||||
void register_link(const pstring &sin, const pstring &sout);
|
||||
void register_param(const pstring ¶m, const pstring &value);
|
||||
void register_param(const pstring ¶m, const double value);
|
||||
|
Loading…
Reference in New Issue
Block a user