From 09a84f713af5b0113abe4869941400ca128f0818 Mon Sep 17 00:00:00 2001 From: Couriersud Date: Wed, 25 Dec 2013 13:54:42 +0000 Subject: [PATCH] Removed legacy code in netlist and separated out 74153 and 74107(A). [Couriersud] --- .gitattributes | 4 + src/emu/machine/netlist.h | 11 --- src/emu/netlist/devices/net_lib.c | 124 ------------------------ src/emu/netlist/devices/net_lib.h | 70 +------------- src/emu/netlist/devices/nld_74107.c | 93 ++++++++++++++++++ src/emu/netlist/devices/nld_74107.h | 106 +++++++++++++++++++++ src/emu/netlist/devices/nld_74153.c | 41 ++++++++ src/emu/netlist/devices/nld_74153.h | 69 ++++++++++++++ src/emu/netlist/devices/nld_7474.h | 2 +- src/emu/netlist/devices/nld_legacy.c | 132 -------------------------- src/emu/netlist/devices/nld_legacy.h | 47 --------- src/emu/netlist/devices/nld_twoterm.h | 2 - src/emu/netlist/netlist.mak | 2 + src/emu/netlist/nl_base.c | 4 - src/emu/netlist/nl_base.h | 15 +-- src/emu/netlist/nl_config.h | 2 +- src/emu/netlist/nl_setup.c | 1 - 17 files changed, 324 insertions(+), 401 deletions(-) create mode 100644 src/emu/netlist/devices/nld_74107.c create mode 100644 src/emu/netlist/devices/nld_74107.h create mode 100644 src/emu/netlist/devices/nld_74153.c create mode 100644 src/emu/netlist/devices/nld_74153.h diff --git a/.gitattributes b/.gitattributes index bddda641a52..e827f153184 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2138,6 +2138,10 @@ src/emu/netlist/devices/nld_7402.h svneol=native#text/plain src/emu/netlist/devices/nld_7404.c svneol=native#text/plain src/emu/netlist/devices/nld_7404.h svneol=native#text/plain src/emu/netlist/devices/nld_7410.h svneol=native#text/plain +src/emu/netlist/devices/nld_74107.c svneol=native#text/plain +src/emu/netlist/devices/nld_74107.h svneol=native#text/plain +src/emu/netlist/devices/nld_74153.c svneol=native#text/plain +src/emu/netlist/devices/nld_74153.h svneol=native#text/plain src/emu/netlist/devices/nld_7420.h svneol=native#text/plain src/emu/netlist/devices/nld_7425.h svneol=native#text/plain src/emu/netlist/devices/nld_7427.h svneol=native#text/plain diff --git a/src/emu/machine/netlist.h b/src/emu/machine/netlist.h index 375cca2a0b3..c8d97307d74 100644 --- a/src/emu/machine/netlist.h +++ b/src/emu/machine/netlist.h @@ -199,19 +199,8 @@ protected: netlist_mame_t *m_netlist; - netlist_setup_t *m_setup; -// more save state ... needs to go somewhere else - - struct qentry { - netlist_time m_time; - char m_name[64]; - }; - - qentry qtemp[1024]; - int qsize; - private: void save_state(); diff --git a/src/emu/netlist/devices/net_lib.c b/src/emu/netlist/devices/net_lib.c index fdb376d6340..13402bb1911 100644 --- a/src/emu/netlist/devices/net_lib.c +++ b/src/emu/netlist/devices/net_lib.c @@ -218,128 +218,6 @@ NETLIB_UPDATE(nic7450) - -NETLIB_START(nic74107Asub) -{ - register_input("CLK", m_clk, netlist_input_t::STATE_INP_HL); - register_output("Q", m_Q); - register_output("QQ", m_QQ); - - m_Q.initial(0); - m_QQ.initial(1); - - save(NAME(m_Q1)); - save(NAME(m_Q2)); - save(NAME(m_F)); -} - -NETLIB_START(nic74107A) -{ - register_sub(sub, "sub"); - - register_subalias("CLK", sub.m_clk); - register_input("J", m_J); - register_input("K", m_K); - register_input("CLRQ", m_clrQ); - register_subalias("Q", sub.m_Q); - register_subalias("QQ", sub.m_QQ); - - sub.m_Q.initial(0); - sub.m_QQ.initial(1); -} - -ATTR_HOT inline void NETLIB_NAME(nic74107Asub)::newstate(const netlist_sig_t state) -{ - const netlist_time delay[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) }; -#if 1 - OUTLOGIC(m_Q, state, delay[state ^ 1]); - OUTLOGIC(m_QQ, state ^ 1, delay[state]); -#else - if (state != Q.new_Q()) - { - Q.setToNoCheck(state, delay[1-state]); - QQ.setToNoCheck(1-state, delay[state]); - } -#endif -} - -NETLIB_UPDATE(nic74107Asub) -{ - { - const netlist_sig_t t = m_Q.net().new_Q(); - newstate((!t & m_Q1) | (t & m_Q2) | m_F); - if (!m_Q1) - m_clk.inactivate(); - } -} - -NETLIB_UPDATE(nic74107A) -{ - if (INPLOGIC(m_J) & INPLOGIC(m_K)) - { - sub.m_Q1 = 1; - sub.m_Q2 = 0; - sub.m_F = 0; - } - else if (!INPLOGIC(m_J) & INPLOGIC(m_K)) - { - sub.m_Q1 = 0; - sub.m_Q2 = 0; - sub.m_F = 0; - } - else if (INPLOGIC(m_J) & !INPLOGIC(m_K)) - { - sub.m_Q1 = 0; - sub.m_Q2 = 0; - sub.m_F = 1; - } - else - { - sub.m_Q1 = 0; - sub.m_Q2 = 1; - sub.m_F = 0; - sub.m_clk.inactivate(); - } - if (!INPLOGIC(m_clrQ)) - { - sub.m_clk.inactivate(); - sub.newstate(0); - } - else if (!sub.m_Q2) - sub.m_clk.activate_hl(); - //if (!sub.m_Q2 & INPLOGIC(m_clrQ)) - // sub.m_clk.activate_hl(); -} - -NETLIB_START(nic74153) -{ - register_input("A1", m_I[0]); - register_input("A2", m_I[1]); - register_input("A3", m_I[2]); - register_input("A4", m_I[3]); - register_input("A", m_A); - register_input("B", m_B); - register_input("GA", m_GA); - - register_output("AY", m_AY); -} - -NETLIB_UPDATE(nic74153) -{ - const netlist_time delay[2] = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) }; - if (!INPLOGIC(m_GA)) - { - UINT8 chan = (INPLOGIC(m_A) | (INPLOGIC(m_B)<<1)); - UINT8 t = INPLOGIC(m_I[chan]); - OUTLOGIC(m_AY, t, delay[t] ); /* data to y only, FIXME */ - } - else - { - OUTLOGIC(m_AY, 0, delay[0]); - } -} - - #define xstr(s) # s #define ENTRY1(_nic, _name) register_device<_nic>( # _name, xstr(_nic) ); #define ENTRY(_nic, _name) ENTRY1(NETLIB_NAME(_nic), _name) @@ -379,7 +257,6 @@ void netlist_factory::initialize() ENTRY(solver, NETDEV_SOLVER) ENTRY(nicMultiSwitch, NETDEV_SWITCH2) ENTRY(nicRSFF, NETDEV_RSFF) - ENTRY(nicMixer8, NETDEV_MIXER) ENTRY(7400, TTL_7400_NAND) ENTRY(7402, TTL_7402_NOR) ENTRY(nic7404, TTL_7404_INVERT) @@ -400,7 +277,6 @@ void netlist_factory::initialize() ENTRY(nic74153, TTL_74153) ENTRY(9316, TTL_9316) ENTRY(NE555, NETDEV_NE555) - ENTRY(nicNE555N_MSTABLE, NE555N_MSTABLE) } netlist_device_t *netlist_factory::new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const diff --git a/src/emu/netlist/devices/net_lib.h b/src/emu/netlist/devices/net_lib.h index 2c696588f97..166a3c1e0dc 100644 --- a/src/emu/netlist/devices/net_lib.h +++ b/src/emu/netlist/devices/net_lib.h @@ -68,6 +68,8 @@ #include "nld_7486.h" #include "nld_7490.h" #include "nld_7493.h" +#include "nld_74107.h" +#include "nld_74153.h" #include "nld_9316.h" #include "nld_ne555.h" @@ -99,25 +101,7 @@ NET_CONNECT(_name, BIQ, _BIQ) \ NET_CONNECT(_name, RBIQ, _RBIQ) -#define TTL_74107A(_name, _CLK, _J, _K, _CLRQ) \ - NET_REGISTER_DEV(nic74107A, _name) \ - NET_CONNECT(_name, CLK, _CLK) \ - NET_CONNECT(_name, J, _J) \ - NET_CONNECT(_name, K, _K) \ - NET_CONNECT(_name, CLRQ, _CLRQ) -#define TTL_74107(_name, _CLK, _J, _K, _CLRQ) \ - TTL_74107A(_name, _CLK, _J, _K, _CLRQ) - -#define TTL_74153(_name, _A1, _A2, _A3, _A4, _A, _B, _GA) \ - NET_REGISTER_DEV(nic74153, _name) \ - NET_CONNECT(_name, A1, _A1) \ - NET_CONNECT(_name, A2, _A2) \ - NET_CONNECT(_name, A3, _A3) \ - NET_CONNECT(_name, A4, _A4) \ - NET_CONNECT(_name, A, _A) \ - NET_CONNECT(_name, B, _B) \ - NET_CONNECT(_name, GA, _GA) // ---------------------------------------------------------------------------------------- // Standard devices ... @@ -131,56 +115,6 @@ NETLIB_DEVICE(nic7450, netlist_ttl_output_t m_Q; ); -/* 74107 does latch data during high ! - * For modelling purposes, we assume 74107 and 74107A are the same - */ - -NETLIB_SUBDEVICE(nic74107Asub, - netlist_ttl_input_t m_clk; - - netlist_ttl_output_t m_Q; - netlist_ttl_output_t m_QQ; - - netlist_sig_t m_Q1; - netlist_sig_t m_Q2; - netlist_sig_t m_F; - - ATTR_HOT void newstate(const netlist_sig_t state); - -); - -NETLIB_DEVICE(nic74107A, - NETLIB_NAME(nic74107Asub) sub; - - netlist_ttl_input_t m_J; - netlist_ttl_input_t m_K; - netlist_ttl_input_t m_clrQ; - -); - -class NETLIB_NAME(nic74107) : public NETLIB_NAME(nic74107A) -{ -public: - NETLIB_NAME(nic74107) () - : NETLIB_NAME(nic74107A) () {} - -}; - - -/* ripple-carry counter on low-high clock transition */ - - - -/* one half of a nic74153 */ - -NETLIB_DEVICE(nic74153, - netlist_ttl_input_t m_I[4]; - netlist_ttl_input_t m_A; - netlist_ttl_input_t m_B; - netlist_ttl_input_t m_GA; - - netlist_ttl_output_t m_AY; -); NETLIB_SUBDEVICE(nic7448_sub, ATTR_HOT void update_outputs(UINT8 v); diff --git a/src/emu/netlist/devices/nld_74107.c b/src/emu/netlist/devices/nld_74107.c new file mode 100644 index 00000000000..51e82bb500a --- /dev/null +++ b/src/emu/netlist/devices/nld_74107.c @@ -0,0 +1,93 @@ +/* + * nld_74107.c + * + */ + +#include "nld_74107.h" + +NETLIB_START(nic74107Asub) +{ + register_input("CLK", m_clk, netlist_input_t::STATE_INP_HL); + register_output("Q", m_Q); + register_output("QQ", m_QQ); + + m_Q.initial(0); + m_QQ.initial(1); + + m_Q1 = 0; + m_Q2 = 0; + m_F = 0; + + save(NAME(m_Q1)); + save(NAME(m_Q2)); + save(NAME(m_F)); +} + +NETLIB_START(nic74107A) +{ + register_sub(sub, "sub"); + + register_subalias("CLK", sub.m_clk); + register_input("J", m_J); + register_input("K", m_K); + register_input("CLRQ", m_clrQ); + register_subalias("Q", sub.m_Q); + register_subalias("QQ", sub.m_QQ); + +} + +ATTR_HOT inline void NETLIB_NAME(nic74107Asub)::newstate(const netlist_sig_t state) +{ + const netlist_time delay[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) }; + + OUTLOGIC(m_Q, state, delay[state ^ 1]); + OUTLOGIC(m_QQ, state ^ 1, delay[state]); +} + +NETLIB_UPDATE(nic74107Asub) +{ + const netlist_sig_t t = m_Q.net().Q(); + newstate((!t & m_Q1) | (t & m_Q2) | m_F); + if (!m_Q1) + m_clk.inactivate(); +} + +NETLIB_UPDATE(nic74107A) +{ + const UINT8 JK = (INPLOGIC(m_J) << 1) | INPLOGIC(m_K); + + switch (JK) + { + case 0: + sub.m_Q1 = 0; + sub.m_Q2 = 1; + sub.m_F = 0; + sub.m_clk.inactivate(); + break; + case 1: // (!INPLOGIC(m_J) & INPLOGIC(m_K)) + sub.m_Q1 = 0; + sub.m_Q2 = 0; + sub.m_F = 0; + break; + case 2: // (INPLOGIC(m_J) & !INPLOGIC(m_K)) + sub.m_Q1 = 0; + sub.m_Q2 = 0; + sub.m_F = 1; + break; + case 3: // (INPLOGIC(m_J) & INPLOGIC(m_K)) + sub.m_Q1 = 1; + sub.m_Q2 = 0; + sub.m_F = 0; + break; + default: + break; + } + + if (!INPLOGIC(m_clrQ)) + { + sub.m_clk.inactivate(); + sub.newstate(0); + } + else if (!sub.m_Q2) + sub.m_clk.activate_hl(); +} diff --git a/src/emu/netlist/devices/nld_74107.h b/src/emu/netlist/devices/nld_74107.h new file mode 100644 index 00000000000..1e16fc0aea0 --- /dev/null +++ b/src/emu/netlist/devices/nld_74107.h @@ -0,0 +1,106 @@ +// license:GPL-2.0+ +// copyright-holders:Couriersud +/* + * nld_74107.h + * + * DM74107: DUAL J-K FLIP-FLOPS WITH CLEAR + * + * +--------------+ + * 1J |1 ++ 14| VCC + * 1QQ |2 13| 1CLRQ + * 1Q |3 12| 1CLK + * 1K |4 74107 11| 2K + * 2Q |5 10| 2CLRQ + * 2QQ |6 9| 2CLK + * GND |7 8| 2J + * +--------------+ + * + * + * Function table 107 + * + * +-----+-----+-----+---++---+-----+ + * | CLRQ| CLK | J | K || Q | QQ | + * +=====+=====+=====+===++===+=====+ + * | 0 | X | X | X || 0 | 1 | + * | 1 | * | 0 | 0 || Q0| Q0Q | + * | 1 | * | 1 | 0 || 1 | 0 | + * | 1 | * | 0 | 1 || 0 | 1 | + * | 1 | * | 1 | 1 || TOGGLE | + * +-----+-----+-----+---++---+-----+ + * _ + * * = _| |_ + * + * This is positive triggered, J and K + * are latched during clock high and + * transferred when CLK falls. + * + * Function table 107A + * + * +-----+-----+-----+---++---+-----+ + * | CLRQ| CLK | J | K || Q | QQ | + * +=====+=====+=====+===++===+=====+ + * | 0 | X | X | X || 0 | 1 | + * | 1 | F | 0 | 0 || Q0| Q0Q | + * | 1 | F | 1 | 0 || 1 | 0 | + * | 1 | F | 0 | 1 || 0 | 1 | + * | 1 | F | 1 | 1 || TOGGLE | + * | 1 | 1 | X | X || Q0| Q0Q | + * +-----+-----+-----+---++---+-----+ + * + * THe 107A is negative triggered. + * + * Naming conventions follow Texas instruments datasheet + * + * FIXME: Currently, only the 107A is implemented. + * The 107 uses the same model. + * + */ + +#ifndef NLD_74107_H_ +#define NLD_74107_H_ + +#include "../nl_base.h" + +#define TTL_74107A(_name, _CLK, _J, _K, _CLRQ) \ + NET_REGISTER_DEV(nic74107A, _name) \ + NET_CONNECT(_name, CLK, _CLK) \ + NET_CONNECT(_name, J, _J) \ + NET_CONNECT(_name, K, _K) \ + NET_CONNECT(_name, CLRQ, _CLRQ) + +#define TTL_74107(_name, _CLK, _J, _K, _CLRQ) \ + TTL_74107A(_name, _CLK, _J, _K, _CLRQ) + +NETLIB_SUBDEVICE(nic74107Asub, + netlist_ttl_input_t m_clk; + + netlist_ttl_output_t m_Q; + netlist_ttl_output_t m_QQ; + + netlist_sig_t m_Q1; + netlist_sig_t m_Q2; + netlist_sig_t m_F; + + ATTR_HOT void newstate(const netlist_sig_t state); + +); + +NETLIB_DEVICE(nic74107A, + NETLIB_NAME(nic74107Asub) sub; + + netlist_ttl_input_t m_J; + netlist_ttl_input_t m_K; + netlist_ttl_input_t m_clrQ; + +); + +class NETLIB_NAME(nic74107) : public NETLIB_NAME(nic74107A) +{ +public: + NETLIB_NAME(nic74107) () + : NETLIB_NAME(nic74107A) () {} + +}; + + +#endif /* NLD_74107_H_ */ diff --git a/src/emu/netlist/devices/nld_74153.c b/src/emu/netlist/devices/nld_74153.c new file mode 100644 index 00000000000..d9b1c071d8f --- /dev/null +++ b/src/emu/netlist/devices/nld_74153.c @@ -0,0 +1,41 @@ +/* + * nld_74153.c + * + */ + +#include "nld_74153.h" + +NETLIB_START(nic74153) +{ + register_input("C0", m_C[0]); + register_input("C1", m_C[1]); + register_input("C2", m_C[2]); + register_input("C3", m_C[3]); + register_input("A", m_A); + register_input("B", m_B); + register_input("G", m_G); + + register_output("AY", m_Y); //FIXME: Change netlists +} + +/* FIXME: timing is not 100% accurate, Strobe and Select inputs have a + * slightly longer timing. + * Convert this to sub-devices at some time. + */ + +NETLIB_UPDATE(nic74153) +{ + const netlist_time delay[2] = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) }; + if (!INPLOGIC(m_G)) + { + UINT8 chan = (INPLOGIC(m_A) | (INPLOGIC(m_B)<<1)); + UINT8 t = INPLOGIC(m_C[chan]); + OUTLOGIC(m_Y, t, delay[t] ); + } + else + { + OUTLOGIC(m_Y, 0, delay[0]); + } +} + + diff --git a/src/emu/netlist/devices/nld_74153.h b/src/emu/netlist/devices/nld_74153.h new file mode 100644 index 00000000000..382e8b86593 --- /dev/null +++ b/src/emu/netlist/devices/nld_74153.h @@ -0,0 +1,69 @@ +// license:GPL-2.0+ +// copyright-holders:Couriersud +/* + * nld_74153.h + * + * DM74153: Dual 4-Line to 1-Line Data Selectors Multiplexers + * + * +--------------+ + * G1 |1 ++ 16| VCC + * B |2 15| G2 + * 1C3 |3 14| A + * 1C2 |4 74153 13| 2C3 + * 1C1 |5 12| 2C2 + * 1C0 |6 11| 2C1 + * Y1 |7 10| 2C0 + * GND |8 9| Y2 + * +--------------+ + * + * + * Function table + * + * +-----+-----++----+----+----+----++----+----+ + * | B | A || C0 | C1 | C2 | C3 || G | Y | + * +=====+=====++====+====+====+====++====+====+ + * | X | X || X | X | X | X || H | L | + * | L | L || L | X | X | X || L | L | + * | L | L || H | X | X | X || L | H | + * | L | H || X | L | X | X || L | L | + * | L | H || X | H | X | X || L | H | + * | H | L || X | X | L | X || L | L | + * | H | L || X | X | H | X || L | H | + * | H | H || X | X | X | L || L | L | + * | H | H || X | X | X | H || L | H | + * +-----+-----++----+----+----+----++----+----+ + * + * A, B : Select Inputs + * C* : Data inputs + * G : Strobe + * Y : Output + * + * Naming conventions follow National Semiconductor datasheet + * + */ + +#ifndef NLD_74153_H_ +#define NLD_74153_H_ + +#include "../nl_base.h" + +#define TTL_74153(_name, _C0, _C1, _C2, _C3, _A, _B, _G) \ + NET_REGISTER_DEV(nic74153, _name) \ + NET_CONNECT(_name, C0, _C0) \ + NET_CONNECT(_name, C1, _C1) \ + NET_CONNECT(_name, C2, _C2) \ + NET_CONNECT(_name, C3, _C3) \ + NET_CONNECT(_name, A, _A) \ + NET_CONNECT(_name, B, _B) \ + NET_CONNECT(_name, G, _G) + +NETLIB_DEVICE(nic74153, + netlist_ttl_input_t m_C[4]; + netlist_ttl_input_t m_A; + netlist_ttl_input_t m_B; + netlist_ttl_input_t m_G; + + netlist_ttl_output_t m_Y; +); + +#endif /* NLD_74153_H_ */ diff --git a/src/emu/netlist/devices/nld_7474.h b/src/emu/netlist/devices/nld_7474.h index 31cf80e0d6d..223f2f6457e 100644 --- a/src/emu/netlist/devices/nld_7474.h +++ b/src/emu/netlist/devices/nld_7474.h @@ -24,7 +24,7 @@ * | 0 | 0 | X | X || 1 | 1 | (*) * | 1 | 1 | R | 1 || 1 | 0 | * | 1 | 1 | R | 0 || 0 | 1 | - * | 1 | 1 | L | X || Q0| Q0Q | + * | 1 | 1 | 0 | X || Q0| Q0Q | * +-----+-----+-----+---++---+-----+ * * (*) his configuration is nonstable that is it will not persist diff --git a/src/emu/netlist/devices/nld_legacy.c b/src/emu/netlist/devices/nld_legacy.c index e23c7287ea0..6f06af44df3 100644 --- a/src/emu/netlist/devices/nld_legacy.c +++ b/src/emu/netlist/devices/nld_legacy.c @@ -38,51 +38,6 @@ NETLIB_UPDATE_PARAM(nicMultiSwitch) //update(); } -NETLIB_START(nicMixer8) -{ - static const char *sI[8] = { "I1", "I2", "I3", "I4", "I5", "I6", "I7", "I8" }; - static const char *sR[8] = { "R1", "R2", "R3", "R4", "R5", "R6", "R7", "R8" }; - int i; - - m_low.initial(0); - - for (i=0; i<8; i++) - { - register_input(sI[i], m_I[i]); - m_low.net().register_con(m_I[i]); - //m_I[i].set_output(m_low); - register_param(sR[i], m_R[i], 1e12); - } - register_output("Q", m_Q); -} - -NETLIB_UPDATE(nicMixer8) -{ - int i; - double r = 0; - - for (i=0; i<8; i++) - { - r += m_w[i] * INPANALOG(m_I[i]); - } - OUTANALOG(m_Q, r, NLTIME_IMMEDIATE); -} - -NETLIB_UPDATE_PARAM(nicMixer8) -{ - double t = 0; - int i; - - for (i=0; i<8; i++) - t += 1.0 / m_R[i].Value(); - t = 1.0 / t; - - for (i=0; i<8; i++) - m_w[i] = t / m_R[i].Value(); -} - - - NETLIB_START(nicRSFF) { register_input("S", m_S); @@ -106,90 +61,3 @@ NETLIB_UPDATE(nicRSFF) OUTLOGIC(m_QQ, 1, NLTIME_FROM_NS(10)); } } - - -NETLIB_START(nicNE555N_MSTABLE) -{ - register_input("TRIG", m_trigger); - register_input("CV", m_CV); - - register_output("Q", m_Q); - register_param("R", m_R, 0.0); - register_param("C", m_C, 0.0); - register_param("VS", m_VS, 5.0); - register_param("VL", m_VL, 0.0 *5.0); - - m_THRESHOLD_OUT.init_object(*this, name() + "THRESHOLD"); - register_link_internal(m_THRESHOLD, m_THRESHOLD_OUT, netlist_input_t::STATE_INP_ACTIVE); - - m_Q.initial(5.0 * 0.4); - m_last = false; - - save(NAME(m_last)); - -} - -inline double NETLIB_NAME(nicNE555N_MSTABLE)::nicNE555N_cv() -{ - return (m_CV.is_highz() ? 0.67 * m_VS.Value() : INPANALOG(m_CV)); -} - -inline double NETLIB_NAME(nicNE555N_MSTABLE)::nicNE555N_clamp(const double v, const double a, const double b) -{ - double ret = v; - if (ret > m_VS.Value() - a) - ret = m_VS.Value() - a; - if (ret < b) - ret = b; - return ret; -} - -NETLIB_UPDATE_PARAM(nicNE555N_MSTABLE) -{ -} - -NETLIB_UPDATE(nicNE555N_MSTABLE) -{ - update_param(); // FIXME : m_CV should be on a sub device ... - - double vt = nicNE555N_clamp(nicNE555N_cv(), 0.7, 1.4); - bool bthresh = (INPANALOG(m_THRESHOLD) > vt); - bool btrig = (INPANALOG(m_trigger) > nicNE555N_clamp(nicNE555N_cv() * 0.5, 0.7, 1.4)); - bool out = m_last; - - if (!btrig) - { - out = true; - } - else if (bthresh) - { - out = false; - } - - if (!m_last && out) - { - double vl = m_VL.Value(); - double time; - - // FIXME : m_CV should be on a sub device ... - - // TI datasheet states minimum pulse of 10 us - if (vtclear(); - printf("qsize %d\n", m_qsize); NL_VERBOSE_OUT(("current time %f qsize %d\n", m_netlist->time().as_double(), qsize)); for (int i = 0; i < m_qsize; i++ ) { netlist_net_t *n = m_netlist.find_net(&(m_name[i][0])); NL_VERBOSE_OUT(("Got %s ==> %p\n", qtemp[i].m_name, n)); - printf("Got %s ==> %p\n", m_name[i], n); NL_VERBOSE_OUT(("schedule time %f (%f)\n", n->time().as_double(), qtemp[i].m_time.as_double())); - printf("schedule time %f (%f)\n", n->time().as_double(), netlist_time::from_raw(m_times[i]).as_double()); this->push(netlist_queue_t::entry_t(netlist_time::from_raw(m_times[i]), *n)); } } diff --git a/src/emu/netlist/nl_base.h b/src/emu/netlist/nl_base.h index 7578933e277..82fedc5c8ab 100644 --- a/src/emu/netlist/nl_base.h +++ b/src/emu/netlist/nl_base.h @@ -368,7 +368,11 @@ public: netlist_core_terminal_t *m_update_list_next; protected: - ATTR_COLD virtual void save_register() { save(NAME(m_state)); netlist_owned_object_t::save_register(); } + ATTR_COLD virtual void save_register() + { + save(NAME(m_state)); + netlist_owned_object_t::save_register(); + } private: netlist_net_t * RESTRICT m_net; @@ -497,7 +501,6 @@ public: ATTR_COLD netlist_analog_input_t() : netlist_input_t(INPUT, ANALOG) { } - ATTR_HOT inline const bool is_highz() const; ATTR_HOT inline const double Q_Analog() const; }; @@ -1019,8 +1022,6 @@ protected: protected: ATTR_COLD virtual void save_register() { - //netlist_queue_t m_queue; - //netlist().save_manager(m_queue.callback(), "m_queue"); save(NAME(m_queue.callback())); save(NAME(m_time_ps)); save(NAME(m_rem)); @@ -1254,12 +1255,6 @@ ATTR_HOT inline const double netlist_analog_input_t::Q_Analog() const return net().Q_Analog(); } -//FIXME: Legacy ... must be removed -ATTR_HOT inline const bool netlist_analog_input_t::is_highz() const -{ - return (net().Q_Analog() == NETLIST_HIGHIMP_V); -} - // ---------------------------------------------------------------------------------------- // net_dev class factory // ---------------------------------------------------------------------------------------- diff --git a/src/emu/netlist/nl_config.h b/src/emu/netlist/nl_config.h index 0f73d57b78c..82f128b09f2 100644 --- a/src/emu/netlist/nl_config.h +++ b/src/emu/netlist/nl_config.h @@ -37,7 +37,7 @@ #define NETLIST_CLOCK (NETLIST_INTERNAL_RES / NETLIST_DIV) //FIXME: LEGACY -#define NETLIST_HIGHIMP_V (1.23456e20) /* some voltage we should never see */ +//#define NETLIST_HIGHIMP_V (1.23456e20) /* some voltage we should never see */ #define NETLIST_GMIN (1e-9) diff --git a/src/emu/netlist/nl_setup.c b/src/emu/netlist/nl_setup.c index e78b7299a16..cfa2c5c5319 100644 --- a/src/emu/netlist/nl_setup.c +++ b/src/emu/netlist/nl_setup.c @@ -15,7 +15,6 @@ static NETLIST_START(base) NETDEV_TTL_CONST(ttlhigh, 1) NETDEV_TTL_CONST(ttllow, 0) - NETDEV_ANALOG_CONST(NC, NETLIST_HIGHIMP_V) NET_MODEL(".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)") NET_MODEL(".model 1N4148 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)")