mirror of
https://github.com/holub/mame
synced 2025-06-17 17:59:05 +03:00
Aligned logic_family usage across objects. (nw)
This commit is contained in:
parent
5cf7b1fb78
commit
00af096b9f
@ -362,7 +362,7 @@ ATTR_COLD void netlist_base_t::log(const char *format, ...) const
|
|||||||
// ----------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
ATTR_COLD netlist_core_device_t::netlist_core_device_t(const family_t afamily)
|
ATTR_COLD netlist_core_device_t::netlist_core_device_t(const family_t afamily)
|
||||||
: netlist_object_t(DEVICE, afamily)
|
: netlist_object_t(DEVICE, afamily), netlist_logic_family_t()
|
||||||
#if (NL_KEEP_STATISTICS)
|
#if (NL_KEEP_STATISTICS)
|
||||||
, stat_total_time(0)
|
, stat_total_time(0)
|
||||||
, stat_update_count(0)
|
, stat_update_count(0)
|
||||||
@ -373,6 +373,7 @@ ATTR_COLD netlist_core_device_t::netlist_core_device_t(const family_t afamily)
|
|||||||
|
|
||||||
ATTR_COLD void netlist_core_device_t::init(netlist_base_t &anetlist, const pstring &name)
|
ATTR_COLD void netlist_core_device_t::init(netlist_base_t &anetlist, const pstring &name)
|
||||||
{
|
{
|
||||||
|
set_logic_family(this->default_logic_family());
|
||||||
init_object(anetlist, name);
|
init_object(anetlist, name);
|
||||||
|
|
||||||
#if USE_PMFDELEGATES
|
#if USE_PMFDELEGATES
|
||||||
@ -443,6 +444,8 @@ ATTR_COLD void netlist_device_t::init(netlist_base_t &anetlist, const pstring &n
|
|||||||
ATTR_COLD void netlist_device_t::register_sub(const pstring &name, netlist_device_t &dev)
|
ATTR_COLD void netlist_device_t::register_sub(const pstring &name, netlist_device_t &dev)
|
||||||
{
|
{
|
||||||
dev.init(netlist(), this->name() + "." + name);
|
dev.init(netlist(), this->name() + "." + name);
|
||||||
|
// FIXME: subdevices always first inherit the logic family of the parent
|
||||||
|
dev.set_logic_family(this->logic_family());
|
||||||
dev.start_dev();
|
dev.start_dev();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -898,7 +901,7 @@ ATTR_COLD void netlist_output_t::init_object(netlist_core_device_t &dev, const p
|
|||||||
// ----------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------
|
||||||
|
|
||||||
ATTR_COLD netlist_logic_output_t::netlist_logic_output_t()
|
ATTR_COLD netlist_logic_output_t::netlist_logic_output_t()
|
||||||
: netlist_output_t(OUTPUT, LOGIC), m_proxy(NULL), m_logic_family(NULL)
|
: netlist_output_t(OUTPUT, LOGIC), netlist_logic_family_t(), m_proxy(NULL)
|
||||||
{
|
{
|
||||||
this->set_net(m_my_net);
|
this->set_net(m_my_net);
|
||||||
}
|
}
|
||||||
|
@ -245,7 +245,7 @@ typedef void (*net_update_delegate)(netlist_core_device_t *);
|
|||||||
, _priv)
|
, _priv)
|
||||||
|
|
||||||
#define NETLIB_LOGIC_FAMILY(_fam) \
|
#define NETLIB_LOGIC_FAMILY(_fam) \
|
||||||
ATTR_COLD virtual const netlist_logic_family_desc_t *logic_family() \
|
ATTR_COLD virtual const netlist_logic_family_desc_t *default_logic_family() \
|
||||||
{ \
|
{ \
|
||||||
return &netlist_family_ ## _fam; \
|
return &netlist_family_ ## _fam; \
|
||||||
}
|
}
|
||||||
@ -290,6 +290,19 @@ public:
|
|||||||
nl_double m_R_high;
|
nl_double m_R_high;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class netlist_logic_family_t
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
netlist_logic_family_t() : m_logic_family(NULL) {}
|
||||||
|
|
||||||
|
ATTR_HOT inline const netlist_logic_family_desc_t *logic_family() const { return m_logic_family; }
|
||||||
|
ATTR_COLD void set_logic_family(const netlist_logic_family_desc_t *fam) { m_logic_family = fam; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
const netlist_logic_family_desc_t *m_logic_family;
|
||||||
|
};
|
||||||
|
|
||||||
/* Terminals inherit the family description from the netlist_device
|
/* Terminals inherit the family description from the netlist_device
|
||||||
* The default is the ttl family, but any device can override the family.
|
* The default is the ttl family, but any device can override the family.
|
||||||
* For individual terminals, these can be overwritten as well.
|
* For individual terminals, these can be overwritten as well.
|
||||||
@ -537,11 +550,11 @@ private:
|
|||||||
// netlist_logic_input_t
|
// netlist_logic_input_t
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
class netlist_logic_input_t : public netlist_input_t
|
class netlist_logic_input_t : public netlist_input_t, public netlist_logic_family_t
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ATTR_COLD netlist_logic_input_t()
|
ATTR_COLD netlist_logic_input_t()
|
||||||
: netlist_input_t(INPUT, LOGIC), m_logic_family(NULL)
|
: netlist_input_t(INPUT, LOGIC), netlist_logic_family_t()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -551,11 +564,6 @@ public:
|
|||||||
ATTR_HOT inline void activate_hl();
|
ATTR_HOT inline void activate_hl();
|
||||||
ATTR_HOT inline void activate_lh();
|
ATTR_HOT inline void activate_lh();
|
||||||
|
|
||||||
ATTR_HOT inline const netlist_logic_family_desc_t *logic_family() { return m_logic_family; }
|
|
||||||
ATTR_COLD void set_logic_family(const netlist_logic_family_desc_t *fam) { m_logic_family = fam; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
const netlist_logic_family_desc_t *m_logic_family;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
@ -786,7 +794,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class netlist_logic_output_t : public netlist_output_t
|
class netlist_logic_output_t : public netlist_output_t, public netlist_logic_family_t
|
||||||
{
|
{
|
||||||
NETLIST_PREVENT_COPYING(netlist_logic_output_t)
|
NETLIST_PREVENT_COPYING(netlist_logic_output_t)
|
||||||
public:
|
public:
|
||||||
@ -804,13 +812,9 @@ public:
|
|||||||
ATTR_COLD nld_base_d_to_a_proxy *get_proxy() const { return m_proxy; }
|
ATTR_COLD nld_base_d_to_a_proxy *get_proxy() const { return m_proxy; }
|
||||||
ATTR_COLD void set_proxy(nld_base_d_to_a_proxy *proxy) { m_proxy = proxy; }
|
ATTR_COLD void set_proxy(nld_base_d_to_a_proxy *proxy) { m_proxy = proxy; }
|
||||||
|
|
||||||
ATTR_HOT inline const netlist_logic_family_desc_t *logic_family() { return m_logic_family; }
|
|
||||||
ATTR_COLD void set_logic_family(const netlist_logic_family_desc_t *fam) { m_logic_family = fam; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
netlist_logic_net_t m_my_net;
|
netlist_logic_net_t m_my_net;
|
||||||
nld_base_d_to_a_proxy *m_proxy;
|
nld_base_d_to_a_proxy *m_proxy;
|
||||||
const netlist_logic_family_desc_t *m_logic_family;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class netlist_ttl_output_t : public netlist_logic_output_t
|
class netlist_ttl_output_t : public netlist_logic_output_t
|
||||||
@ -954,7 +958,7 @@ private:
|
|||||||
// net_device_t
|
// net_device_t
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
class netlist_core_device_t : public netlist_object_t
|
class netlist_core_device_t : public netlist_object_t, public netlist_logic_family_t
|
||||||
{
|
{
|
||||||
NETLIST_PREVENT_COPYING(netlist_core_device_t)
|
NETLIST_PREVENT_COPYING(netlist_core_device_t)
|
||||||
public:
|
public:
|
||||||
@ -1024,7 +1028,7 @@ protected:
|
|||||||
|
|
||||||
ATTR_HOT virtual void update() { }
|
ATTR_HOT virtual void update() { }
|
||||||
ATTR_COLD virtual void start() { }
|
ATTR_COLD virtual void start() { }
|
||||||
ATTR_COLD virtual const netlist_logic_family_desc_t *logic_family()
|
ATTR_COLD virtual const netlist_logic_family_desc_t *default_logic_family()
|
||||||
{
|
{
|
||||||
return &netlist_family_TTL;
|
return &netlist_family_TTL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user