Previous 199869 Revisions Next

r26531 Saturday 7th December, 2013 at 23:41:12 UTC by Couriersud
Netlist: added a simplified BJT Switch Model. This should be sufficient for audio purposes in >> 90% of all cases I have seen so far.
The performance of the analog subsystem has quite some room for improvement :-(
[src/emu/netlist]nl_base.c nl_base.h nl_lists.h
[src/emu/netlist/devices]net_lib.c nld_system.c nld_system.h nld_twoterm.c nld_twoterm.h
[src/mame/drivers]pong.c

trunk/src/mame/drivers/pong.c
r26530r26531
588588    //NETDEV_LOG(log3, 555.OUT)
589589#endif
590590
591#if 0
592    NETDEV_BC238B(Q)
593    NETDEV_R(RB, 1000)
594    NETDEV_R(RC, 1000)
591595
596    NET_C(RC.1, V5)
597    NET_C(RC.2, Q.C)
598    NET_C(RB.1, 128H)
599    NET_C(RB.2, Q.B)
600    NET_C(Q.E, GND)
601    //NETDEV_LOG(logB, Q.B)
602    //NETDEV_LOG(logC, Q.C)
603#endif
604
605
606
592607NETLIST_END
593608
594609static NETLIST_START(pong)
trunk/src/emu/netlist/devices/nld_system.c
r26530r26531
44 */
55
66#include "nld_system.h"
7#include "nld_twoterm.h"
78
89// ----------------------------------------------------------------------------------------
910// netdev_const
r26530r26531
9293    register_param("FREQ", m_freq, 48000.0);
9394    m_inc = netlist_time::from_hz(m_freq.Value());
9495
96    register_param("ACCURACY", m_accuracy, 1e-3);
97
9598    register_link_internal(m_fb_sync, m_Q_sync, netlist_input_t::STATE_INP_ACTIVE);
9699    register_link_internal(m_fb_step, m_Q_step, netlist_input_t::STATE_INP_ACTIVE);
97100    m_last_step = netlist_time::zero;
r26530r26531
116119
117120NETLIB_FUNC_VOID(solver, post_start, ())
118121{
122
119123    NL_VERBOSE_OUT(("post start solver ...\n"));
120124    for (net_list_t::entry_t *pn = m_nets.first(); pn != NULL; pn = m_nets.next(pn))
121125    {
r26530r26531
127131                case netlist_terminal_t::TERMINAL:
128132                    m_terms.add(p);
129133                    NL_VERBOSE_OUT(("Added terminal\n"));
134                    if (p->netdev().isFamily(CAPACITOR))
135                        if (!m_steps.contains(&p->netdev()))
136                            m_steps.add(&p->netdev());
130137                    break;
131138                case netlist_terminal_t::INPUT:
132139                    m_inps.add(p);
r26530r26531
154161    //OUTLOGIC(m_Q, !m_Q.net().new_Q(), m_inc  );
155162
156163    bool resched = false;
164    int  resched_cnt = 0;
157165    netlist_time now = netlist().time();
158166    netlist_time delta = now - m_last_step;
159167
r26530r26531
162170        NL_VERBOSE_OUT(("Step!\n"));
163171        /* update all terminals for new time step */
164172        m_last_step = now;
165        for (terminal_list_t::entry_t *p = m_terms.first(); p != NULL; p = m_terms.next(p))
166            p->object()->netdev().step_time(delta.as_double());
173        for (dev_list_t::entry_t *p = m_steps.first(); p != NULL; p = m_steps.next(p))
174            p->object()->step_time(delta.as_double());
167175    }
168    for (net_list_t::entry_t *pn = m_nets.first(); pn != NULL; pn = m_nets.next(pn))
169    {
170        double gtot = 0;
171        double iIdr = 0;
176    do {
177        resched = false;
172178
173        for (netlist_core_terminal_t *p = pn->object()->m_head; p != NULL; p = p->m_update_list_next)
179        for (net_list_t::entry_t *pn = m_nets.first(); pn != NULL; pn = m_nets.next(pn))
174180        {
175            if (p->isType(netlist_core_terminal_t::TERMINAL))
181            netlist_net_t *net = pn->object();
182
183            double gtot = 0;
184            double iIdr = 0;
185
186            for (netlist_core_terminal_t *p = net->m_head; p != NULL; p = p->m_update_list_next)
176187            {
177                netlist_terminal_t *pt = static_cast<netlist_terminal_t *>(p);
178                pt->netdev().update_terminals();
179                gtot += pt->m_g;
180                iIdr += pt->m_Idr;
188                if (p->isType(netlist_core_terminal_t::TERMINAL))
189                {
190                    netlist_terminal_t *pt = static_cast<netlist_terminal_t *>(p);
191                    netlist_core_device_t &dev = pt->netdev();
192#if 0
193                    switch (pt->family())
194                    {
195                        case RESISTOR:
196                            static_cast<NETLIB_NAME(R) &>(dev).update_terminals();
197                            break;
198                        case CAPACITOR:
199                            static_cast<NETLIB_NAME(C) &>(dev).update_terminals();
200                            break;
201#if 1
202                        case DIODE:
203                            static_cast<NETLIB_NAME(D) &>(dev).update_terminals();
204                            break;
205                        case BJT_SWITCH_NPN:
206                            static_cast<NETLIB_NAME(QNPN_switch) &>(dev).update_terminals();
207                            break;
208#endif
209                        default:
210                            dev.update_terminals();
211                            break;
212                    }
213#else
214                    dev.update_terminals();
215#endif
216                    gtot += pt->m_g;
217                    iIdr += pt->m_Idr;
218                }
181219            }
182        }
183220
184        double new_val = iIdr / gtot;
185        if (fabs(new_val - pn->object()->m_cur.Analog) > 1e-4)
186            resched = true;
187        pn->object()->m_cur.Analog = pn->object()->m_new.Analog = new_val;
221            double new_val = iIdr / gtot;
222            if (fabs(new_val - net->m_cur.Analog) > m_accuracy.Value())
223                resched = true;
224            resched_cnt++;
225            net->m_cur.Analog = net->m_new.Analog = new_val;
188226
189        NL_VERBOSE_OUT(("Info: %d\n", pn->object()->m_num_cons));
190        NL_VERBOSE_OUT(("New: %lld %f %f\n", netlist().time().as_raw(), netlist().time().as_double(), new_val));
191    }
227            NL_VERBOSE_OUT(("Info: %d\n", pn->object()->m_num_cons));
228            NL_VERBOSE_OUT(("New: %lld %f %f\n", netlist().time().as_raw(), netlist().time().as_double(), new_val));
229        }
230    } while (resched && (resched_cnt < 1));
231    //if (resched_cnt >= 5)
232    //    printf("rescheduled\n");
192233    if (resched)
193234    {
194235        schedule();
195236    }
237#if 1
196238    else
239#endif
197240    {
198241        /* update all inputs connected */
199242#if 0
r26530r26531
201244        {
202245            if (pn->object()->m_cur.Analog != pn->object()->m_last.Analog)
203246            {
204                for (netlist_terminal_t *p = pn->object()->m_head; p != NULL; p = p->m_update_list_next)
247                for (netlist_core_terminal_t *p = pn->object()->m_head; p != NULL; p = p->m_update_list_next)
205248                {
206249                    if (p->isType(netlist_terminal_t::INPUT))
207250                        p->netdev().update_dev();
trunk/src/emu/netlist/devices/nld_system.h
r26530r26531
8282NETLIB_DEVICE_WITH_PARAMS(solver,
8383        typedef netlist_list_t<netlist_core_terminal_t *> terminal_list_t;
8484        typedef netlist_list_t<netlist_net_t *>      net_list_t;
85        typedef netlist_list_t<netlist_core_device_t *>      dev_list_t;
8586
8687        netlist_ttl_input_t m_fb_sync;
8788        netlist_ttl_output_t m_Q_sync;
r26530r26531
9192
9293        netlist_param_double_t m_freq;
9394        netlist_param_double_t m_sync_delay;
95        netlist_param_double_t m_accuracy;
9496
9597        netlist_time m_inc;
9698        netlist_time m_last_step;
r26530r26531
98100
99101        terminal_list_t m_terms;
100102        terminal_list_t m_inps;
103        dev_list_t m_steps;
101104
102105public:
103106
trunk/src/emu/netlist/devices/nld_twoterm.c
r26530r26531
9494{
9595    NETLIB_NAME(twoterm)::update();
9696}
97
98class diode
99{
100public:
101    diode() : m_Is(1e-15), m_VT(0.0258), m_VT_inv(1.0 / m_VT) {}
102    diode(const double Is, const double n)
103    {
104        m_Is = Is;
105        m_VT = 0.0258 * n;
106        m_VT_inv = 1.0 / m_VT;
107    }
108    void set(const double Is, const double n)
109    {
110        m_Is = Is;
111        m_VT = 0.0258 * n;
112        m_VT_inv = 1.0 / m_VT;
113    }
114    double I(const double V) const { return m_Is * exp(V * m_VT_inv) - m_Is; }
115    double g(const double V) const { return m_Is * m_VT_inv * exp(V * m_VT_inv); }
116    double V(const double I) const { return log(1.0 + I / m_Is) * m_VT; }
117    double gI(const double I) const { return m_VT_inv * (I + m_Is); }
118
119private:
120    double m_Is;
121    double m_VT;
122    double m_VT_inv;
123};
124
125// ----------------------------------------------------------------------------------------
126// nld_Q
127// ----------------------------------------------------------------------------------------
128
129NETLIB_START(Q)
130{
131    register_param("model", m_model, "");
132}
133
134NETLIB_START(QBJT)
135{
136    NETLIB_NAME(Q)::start();
137
138    register_terminal("B", m_B);
139    register_terminal("C", m_C);
140    register_terminal("E", m_E);
141
142}
143
144NETLIB_UPDATE(Q)
145{
146    netlist().solver()->schedule();
147}
148
149template <NETLIB_NAME(Q)::q_type _type>
150NETLIB_UPDATE_PARAM(QBJT_switch<_type>)
151{
152    double IS = m_model.dValue("IS", 1e-15);
153    double BF = m_model.dValue("BF", 100);
154    double NF = m_model.dValue("NF", 1);
155    //double VJE = m_model.dValue("VJE", 0.75);
156
157    double alpha = BF / (1.0 + BF);
158
159    diode d(IS, NF);
160
161    // Assume 5mA Collector current for switch operation
162
163    if (_type == BJT_NPN)
164        m_V = d.V(0.005 / alpha);
165    else
166        m_V = - d.V(0.005 / alpha);
167
168    m_gB = d.gI(0.005 / alpha);
169    if (m_gB < NETLIST_GMIN)
170        m_gB = NETLIST_GMIN;
171    m_gC = BF * m_gB; // very rough estimate
172    printf("%f %f \n", m_V, m_gB);
173}
174
175template NETLIB_UPDATE_PARAM(QBJT_switch<NETLIB_NAME(Q)::BJT_NPN>);
176template NETLIB_UPDATE_PARAM(QBJT_switch<NETLIB_NAME(Q)::BJT_PNP>);
trunk/src/emu/netlist/devices/nld_twoterm.h
r26530r26531
6262// nld_twoterm
6363// ----------------------------------------------------------------------------------------
6464
65class nld_twoterm : public netlist_device_t
65class NETLIB_NAME(twoterm) : public netlist_device_t
6666{
6767public:
68    nld_twoterm()
69    : netlist_device_t(), m_g(0.0), m_V(0.0), m_I(0.0) { }
68    ATTR_COLD NETLIB_NAME(twoterm)(const family_t afamily)
69    : netlist_device_t(afamily), m_g(0.0), m_V(0.0), m_I(0.0) { }
7070
7171    netlist_terminal_t m_P;
7272    netlist_terminal_t m_N;
7373
74protected:
75    virtual void start();
76
7774    virtual NETLIB_UPDATE_TERMINALS()
7875    {
7976        m_P.m_g = m_N.m_g = m_g;
r26530r26531
8178        m_P.m_Idr = (m_N.net().Q_Analog() + m_V) * m_g - m_I;
8279        //printf("%f %f %f %f\n", m_N.m_Idr, m_P.m_Idr, m_N.net().Q_Analog(), m_P.net().Q_Analog());
8380    }
84
81protected:
82    ATTR_COLD virtual void start();
8583    ATTR_HOT ATTR_ALIGN void update();
8684
8785    double m_g; // conductance
r26530r26531
9492// nld_R
9593// ----------------------------------------------------------------------------------------
9694
97NETLIB_DEVICE_WITH_PARAMS_DERIVED(R, twoterm,
98        netlist_param_double_t m_R;
95class NETLIB_NAME(R) : public NETLIB_NAME(twoterm)
96{
97public:
98    ATTR_COLD NETLIB_NAME(R)() : NETLIB_NAME(twoterm)(RESISTOR) { }
9999
100    NETLIB_UPDATE_TERMINALS() { NETLIB_NAME(twoterm)::update_terminals(); }
100    inline void set_R(const double R) { m_g = 1.0 / R; }
101101
102public:
103    inline void set_R(double R) { m_g = 1.0 / R; }
102protected:
103    ATTR_COLD virtual void start();
104    ATTR_COLD virtual void update_param();
105    ATTR_HOT ATTR_ALIGN void update();
104106
105);
107    netlist_param_double_t m_R;
106108
109};
110
107111// ----------------------------------------------------------------------------------------
108112// nld_C
109113// ----------------------------------------------------------------------------------------
110114
111NETLIB_DEVICE_WITH_PARAMS_DERIVED(C, twoterm,
115class NETLIB_NAME(C) : public NETLIB_NAME(twoterm)
116{
117public:
118    ATTR_COLD NETLIB_NAME(C)() : NETLIB_NAME(twoterm)(CAPACITOR) { }
112119
113    netlist_param_double_t m_C;
114
115120    ATTR_HOT void step_time(const double st)
116121    {
117122        m_g = m_P.m_g = m_N.m_g = m_C.Value() / st;
118123        m_I = -m_g * (m_P.net().Q_Analog()- m_N.net().Q_Analog());
119124    }
120125
121);
126protected:
127    ATTR_COLD virtual void start();
128    ATTR_COLD virtual void update_param();
129    ATTR_HOT ATTR_ALIGN void update();
122130
131    netlist_param_double_t m_C;
132
133};
134
123135// ----------------------------------------------------------------------------------------
124136// nld_D
125137// ----------------------------------------------------------------------------------------
126138
127NETLIB_DEVICE_WITH_PARAMS_DERIVED(D, twoterm,
139class NETLIB_NAME(D) : public NETLIB_NAME(twoterm)
140{
141public:
142    ATTR_COLD NETLIB_NAME(D)() : NETLIB_NAME(twoterm)(DIODE) { }
128143
144    NETLIB_UPDATE_TERMINALS()
145    {
146        const double nVd = m_P.net().Q_Analog()- m_N.net().Q_Analog();
147
148        //FIXME: Optimize cutoff case
149        m_Vd = (nVd > m_Vcrit) ? m_Vd + log((nVd - m_Vd) * m_VtInv + 1.0) * m_Vt : nVd;
150
151        const double eVDVt = exp(m_Vd * m_VtInv);
152        const double Id = m_Is * (eVDVt - 1.0);
153
154        m_g = m_Is * m_VtInv * eVDVt;
155
156        m_I = (Id - m_Vd * m_g);
157        //printf("Vd: %f %f %f %f\n", m_Vd, m_g, Id, m_I);
158
159        NETLIB_NAME(twoterm)::update_terminals();
160    }
161
162protected:
163    ATTR_COLD virtual void start();
164    ATTR_COLD virtual void update_param();
165    ATTR_HOT ATTR_ALIGN void update();
166
129167    netlist_param_multi_t m_model;
130168
131169    double m_Vt;
r26530r26531
136174    double m_Vcrit;
137175    double m_Vd;
138176
177};
178
179/*
180 *         + -              C
181 *   B ----VVV----+         |
182 *                |         |
183 *                Rb        Rc
184 *                Rb        Rc
185 *                Rb        Rc
186 *                |         |
187 *                +----+----+
188 *                     |
189 *                     E
190 */
191
192#define NETDEV_QPNP(_name, _model)                                                 \
193        NET_REGISTER_DEV(QPNP_switch, _name)                                       \
194        NETDEV_PARAMI(_name,  model, _model)
195
196#define NETDEV_QNPN(_name, _model)                                                 \
197        NET_REGISTER_DEV(QNPN_switch, _name)                                       \
198        NETDEV_PARAMI(_name,  model, _model)
199
200#define NETDEV_BC238B(_name) NETDEV_QNPN(_name, "IS=1.8E-14 ISE=5.0E-14 ISC=1.72E-13 XTI=3 BF=400 BR=35.5 IKF=0.14 IKR=0.03 XTB=1.5 VAF=80 VAR=12.5 VJE=0.58 VJC=0.54 RE=0.6 RC=0.25 RB=0.56 CJE=13E-12 CJC=4E-12 XCJC=0.75 FC=0.5 NF=0.9955 NR=1.005 NE=1.46 NC=1.27 MJE=0.33 MJC=0.33 TF=0.64E-9 TR=50.72E-9 EG=1.11 KF=0 AF=1 VCEO=45V ICRATING=100M MFG=ZETEX")
201
202// Have a common start for transistors
203
204class NETLIB_NAME(Q) : public netlist_device_t
205{
206public:
207    enum q_type {
208        BJT_NPN,
209        BJT_PNP
210    };
211
212    ATTR_COLD NETLIB_NAME(Q)(const q_type atype, const family_t afamily)
213    : netlist_device_t(afamily)
214    , m_qtype(atype) { }
215
216    inline q_type qtype() const { return m_qtype; }
217    inline bool is_qtype(q_type atype) const { return m_qtype == atype; }
218protected:
219    ATTR_COLD virtual void start();
220    ATTR_HOT ATTR_ALIGN void update();
221
222    netlist_param_multi_t m_model;
223private:
224    q_type m_qtype;
225};
226
227class NETLIB_NAME(QBJT) : public NETLIB_NAME(Q)
228{
229public:
230
231    ATTR_COLD NETLIB_NAME(QBJT)(const q_type atype, const family_t afamily)
232    : NETLIB_NAME(Q)(atype, afamily) { }
233
234    netlist_terminal_t m_B;
235    netlist_terminal_t m_C;
236    netlist_terminal_t m_E;
237
238protected:
239    ATTR_COLD virtual void start();
240
241private:
242};
243
244//NETLIB_NAME(Q) nld_Q::q_type
245template <NETLIB_NAME(Q)::q_type _type>
246class NETLIB_NAME(QBJT_switch) : public NETLIB_NAME(QBJT)
247{
248public:
249    ATTR_COLD NETLIB_NAME(QBJT_switch)()
250    : NETLIB_NAME(QBJT)(_type, BJT_SWITCH_NPN), m_gB(NETLIST_GMIN), m_gC(NETLIST_GMIN), m_V(0.0) { }
251
139252    NETLIB_UPDATE_TERMINALS()
140253    {
141        const double nVd = m_P.net().Q_Analog()- m_N.net().Q_Analog();
254        double gb = m_gB;
255        double gc = m_gC;
256        double v  = m_V;
257        double vE = m_E.net().Q_Analog();
258        double vB = m_B.net().Q_Analog();
142259
143        //FIXME: Optimize cutoff case
144        m_Vd = (nVd > m_Vcrit) ? m_Vd + log((nVd - m_Vd) * m_VtInv + 1.0) * m_Vt : nVd;
260        if (vB - vE < m_V )
261        {
262            // not conducting
263            gb = NETLIST_GMIN;
264            v = 0;
265            gc = NETLIST_GMIN;
266        }
145267
146        const double eVDVt = exp(m_Vd * m_VtInv);
147        const double Id = m_Is * (eVDVt - 1.0);
268        m_B.m_g = m_E.m_g = gb;
269        m_C.m_g = gc;
148270
149        m_g = m_Is * m_VtInv * eVDVt;
271        m_B.m_Idr = (vE + v) * gb;
272        m_C.m_Idr = (vE) * gc;
273        m_E.m_Idr = (vB - v) * gb + m_C.net().Q_Analog() * gc;
274    }
150275
151        m_I = (Id - m_Vd * m_g);
152        //printf("Vd: %f %f %f %f\n", m_Vd, m_g, Id, m_I);
276protected:
153277
154        nld_twoterm::update_terminals();
155    }
278    ATTR_COLD void update_param();
156279
280    double m_gB; // conductance
281    double m_gC; // conductance
282    double m_V; // internal voltage source
157283private:
158);
284};
159285
286typedef NETLIB_NAME(QBJT_switch)<NETLIB_NAME(Q)::BJT_PNP> NETLIB_NAME(QPNP_switch);
287typedef NETLIB_NAME(QBJT_switch)<NETLIB_NAME(Q)::BJT_NPN> NETLIB_NAME(QNPN_switch);
160288
161289#endif /* NLD_TWOTERM_H_ */
trunk/src/emu/netlist/devices/net_lib.c
r26530r26531
786786    ENTRY(R,                    NETDEV_R)
787787    ENTRY(C,                    NETDEV_C)
788788    ENTRY(D,                    NETDEV_D)
789    ENTRY(QPNP_switch,          NETDEV_QPNP)
790    ENTRY(QNPN_switch,          NETDEV_QNPN)
789791    ENTRY(ttl_const,            NETDEV_TTL_CONST)
790792    ENTRY(analog_const,         NETDEV_ANALOG_CONST)
791793    ENTRY(logic_input,          NETDEV_LOGIC_INPUT)
trunk/src/emu/netlist/nl_base.c
r26530r26531
197197// net_core_device_t
198198// ----------------------------------------------------------------------------------------
199199
200netlist_core_device_t::netlist_core_device_t()
201: netlist_object_t(DEVICE, ALL)
200ATTR_COLD netlist_core_device_t::netlist_core_device_t()
201: netlist_object_t(DEVICE, GENERIC)
202202{
203203}
204204
205ATTR_COLD netlist_core_device_t::netlist_core_device_t(const family_t afamily)
206: netlist_object_t(DEVICE, afamily)
207{
208}
209
205210ATTR_COLD void netlist_core_device_t::init(netlist_setup_t &setup, const pstring &name)
206211{
207212    init_object(setup.netlist(), name);
r26530r26531
218223
219224}
220225
221netlist_core_device_t::~netlist_core_device_t()
226ATTR_COLD netlist_core_device_t::~netlist_core_device_t()
222227{
223228}
224229
r26530r26531
226231// net_device_t
227232// ----------------------------------------------------------------------------------------
228233
234netlist_device_t::netlist_device_t()
235    : netlist_core_device_t(),
236        m_terminals(20),
237        m_setup(NULL),
238        m_variable_input_count(false)
239{
240}
241
242netlist_device_t::netlist_device_t(const family_t afamily)
243    : netlist_core_device_t(afamily),
244        m_terminals(20),
245        m_setup(NULL),
246        m_variable_input_count(false)
247{
248}
249
250netlist_device_t::~netlist_device_t()
251{
252    //NL_VERBOSE_OUT(("~net_device_t\n");
253}
254
255
229256ATTR_HOT ATTR_ALIGN const netlist_sig_t netlist_core_device_t::INPLOGIC_PASSIVE(netlist_logic_input_t &inp)
230257{
231258   if (inp.state() == netlist_input_t::STATE_INP_PASSIVE)
r26530r26531
240267
241268}
242269
243netlist_device_t::netlist_device_t()
244   : netlist_core_device_t(),
245      m_terminals(20),
246      m_setup(NULL),
247      m_variable_input_count(false)
248{
249}
250
251netlist_device_t::~netlist_device_t()
252{
253   //NL_VERBOSE_OUT(("~net_device_t\n");
254}
255
256270ATTR_COLD void netlist_device_t::init(netlist_setup_t &setup, const pstring &name)
257271{
258272   netlist_core_device_t::init(setup, name);
r26530r26531
538552
539553ATTR_COLD double netlist_param_multi_t::dValue(const pstring &entity, const double defval) const
540554{
541    pstring tmp = this->Value();
555    pstring tmp = this->Value().ucase();
542556    // .model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)
543    int p = tmp.find(entity);
557    int p = tmp.find(entity.ucase() + "=");
544558    if (p>=0)
545559    {
546560        int pblank = tmp.find(" ", p);
trunk/src/emu/netlist/nl_base.h
r26530r26531
238238        TERMINAL = 0,
239239      INPUT    = 1,
240240      OUTPUT   = 2,
241      DEVICE   = 3,
242      PARAM    = 4,
243      NET      = 5
241      PARAM    = 3,
242      NET      = 4,
243        DEVICE   = 5,
244244   };
245245    enum family_t {
246        LOGIC    = 1,
247        ANALOG   = 2,
248        CURRENT  = 3,
249        ALL      = 4   // <== devices usually fall into this category
246        // Terminal families
247        LOGIC     = 1,
248        ANALOG    = 2,
249        // Device families
250        GENERIC   = 3,   // <== devices usually fall into this category
251        RESISTOR  = 4,   // Resistor
252        CAPACITOR = 5,   // Capacitor
253        DIODE     = 6,   // Diode
254        BJT_SWITCH_NPN = 7,  // BJT(Switch)
250255    };
251256
252257   ATTR_COLD netlist_object_t(const type_t atype, const family_t afamily);
r26530r26531
708713public:
709714
710715    ATTR_COLD netlist_core_device_t();
716    ATTR_COLD netlist_core_device_t(const family_t afamily);
711717
712718    ATTR_COLD virtual ~netlist_core_device_t();
713719
r26530r26531
792798public:
793799
794800   ATTR_COLD netlist_device_t();
801    ATTR_COLD netlist_device_t(const family_t afamily);
795802
796803   ATTR_COLD virtual ~netlist_device_t();
797804
trunk/src/emu/netlist/nl_lists.h
r26530r26531
7575            }
7676        }
7777    }
78    ATTR_HOT inline bool contains(const _ListClass elem) const
79    {
80        for (entry_t *i = m_list; i <= m_ptr; i++)
81        {
82            if (i->object() == elem)
83                return true;
84        }
85        return false;
86    }
7887   ATTR_HOT inline entry_t *first() const { return (m_ptr >= m_list ? &m_list[0] : NULL ); }
7988    ATTR_HOT inline entry_t *next(entry_t *lc) const { return (lc < last() ? lc + 1 : NULL ); }
8089   ATTR_HOT inline entry_t *last() const { return m_ptr; }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team