mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
netlist: add more defines to nltool -v --version output
- breakout: update notes - 9316: switch to output array - ppmf: fix a warning - nlid_system.h: remove useless brackets.
This commit is contained in:
parent
98d76709e1
commit
c14db5e7ab
@ -25,10 +25,7 @@ namespace netlist
|
||||
, m_LOADQ(*this, "LOADQ")
|
||||
, m_ENP(*this, "ENP")
|
||||
, m_CLRQ(*this, "CLRQ")
|
||||
, m_A(*this, "A", NETLIB_DELEGATE(9316, abcd))
|
||||
, m_B(*this, "B", NETLIB_DELEGATE(9316, abcd))
|
||||
, m_C(*this, "C", NETLIB_DELEGATE(9316, abcd))
|
||||
, m_D(*this, "D", NETLIB_DELEGATE(9316, abcd))
|
||||
, m_ABCD(*this, {{"A", "B", "C", "D"}}, NETLIB_DELEGATE(9316, abcd))
|
||||
, m_Q(*this, {{ "QA", "QB", "QC", "QD" }})
|
||||
, m_cnt(*this, "m_cnt", 0)
|
||||
, m_abcd(*this, "m_abcd", 0)
|
||||
@ -61,8 +58,8 @@ namespace netlist
|
||||
m_CLK.inactivate();
|
||||
if (!CLRQ && (m_cnt>0))
|
||||
{
|
||||
update_outputs_all(0, NLTIME_FROM_NS(36));
|
||||
m_cnt = 0;
|
||||
update_outputs_all(m_cnt, NLTIME_FROM_NS(36));
|
||||
}
|
||||
}
|
||||
m_RC.push(m_ent && (m_cnt == MAXCNT), NLTIME_FROM_NS(27));
|
||||
@ -79,7 +76,7 @@ namespace netlist
|
||||
|
||||
NETLIB_HANDLERI(abcd)
|
||||
{
|
||||
m_abcd = static_cast<uint8_t>((m_D() << 3) | (m_C() << 2) | (m_B() << 1) | (m_A() << 0));
|
||||
m_abcd = static_cast<uint8_t>((m_ABCD[0]() << 0) | (m_ABCD[1]() << 1) | (m_ABCD[2]() << 2) | (m_ABCD[3]() << 3));
|
||||
}
|
||||
|
||||
logic_input_t m_CLK;
|
||||
@ -92,22 +89,18 @@ namespace netlist
|
||||
logic_input_t m_ENP;
|
||||
logic_input_t m_CLRQ;
|
||||
|
||||
logic_input_t m_A;
|
||||
logic_input_t m_B;
|
||||
logic_input_t m_C;
|
||||
logic_input_t m_D;
|
||||
|
||||
object_array_t<logic_input_t, 4> m_ABCD;
|
||||
object_array_t<logic_output_t, 4> m_Q;
|
||||
|
||||
/* counter state */
|
||||
state_var<unsigned> m_cnt;
|
||||
state_var<uint8_t> m_cnt;
|
||||
/* cached pins */
|
||||
state_var_u8 m_abcd;
|
||||
state_var_sig m_loadq;
|
||||
state_var_sig m_ent;
|
||||
nld_power_pins m_power_pins;
|
||||
|
||||
void update_outputs_all(unsigned cnt, netlist_time out_delay) noexcept
|
||||
void update_outputs_all(uint8_t cnt, netlist_time out_delay) noexcept
|
||||
{
|
||||
m_Q[0].push((cnt >> 0) & 1, out_delay);
|
||||
m_Q[1].push((cnt >> 1) & 1, out_delay);
|
||||
|
@ -171,32 +171,33 @@ namespace devices
|
||||
m_inc[0] = netlist_time::from_double(1.0 / (m_freq() * 2.0));
|
||||
|
||||
connect(m_feedback, m_Q);
|
||||
|
||||
netlist_time base = netlist_time::from_double(1.0 / (m_freq()*2.0));
|
||||
std::vector<pstring> pat(plib::psplit(m_pattern(),","));
|
||||
m_off = netlist_time::from_double(m_offset());
|
||||
|
||||
std::array<std::int64_t, 32> pati = { 0 };
|
||||
|
||||
m_size = static_cast<std::uint8_t>(pat.size());
|
||||
netlist_time::mult_type total = 0;
|
||||
for (unsigned i=0; i<m_size; i++)
|
||||
{
|
||||
netlist_time base = netlist_time::from_double(1.0 / (m_freq()*2.0));
|
||||
std::vector<pstring> pat(plib::psplit(m_pattern(),","));
|
||||
m_off = netlist_time::from_double(m_offset());
|
||||
|
||||
std::array<std::int64_t, 32> pati = { 0 };
|
||||
|
||||
m_size = static_cast<std::uint8_t>(pat.size());
|
||||
netlist_time::mult_type total = 0;
|
||||
for (unsigned i=0; i<m_size; i++)
|
||||
{
|
||||
// FIXME: use pstonum_ne
|
||||
//pati[i] = plib::pstonum<decltype(pati[i])>(pat[i]);
|
||||
pati[i] = plib::pstonum<std::int64_t, true>(pat[i]);
|
||||
total += pati[i];
|
||||
}
|
||||
netlist_time ttotal = netlist_time::zero();
|
||||
auto sm1 = static_cast<uint8_t>(m_size - 1);
|
||||
for (unsigned i=0; i < sm1; i++)
|
||||
{
|
||||
m_inc[i] = base * pati[i];
|
||||
ttotal += m_inc[i];
|
||||
}
|
||||
m_inc[sm1] = base * total - ttotal;
|
||||
// FIXME: use pstonum_ne
|
||||
//pati[i] = plib::pstonum<decltype(pati[i])>(pat[i]);
|
||||
pati[i] = plib::pstonum<std::int64_t, true>(pat[i]);
|
||||
total += pati[i];
|
||||
}
|
||||
netlist_time ttotal = netlist_time::zero();
|
||||
auto sm1 = static_cast<uint8_t>(m_size - 1);
|
||||
for (unsigned i=0; i < sm1; i++)
|
||||
{
|
||||
m_inc[i] = base * pati[i];
|
||||
ttotal += m_inc[i];
|
||||
}
|
||||
m_inc[sm1] = base * total - ttotal;
|
||||
|
||||
}
|
||||
|
||||
NETLIB_UPDATEI();
|
||||
NETLIB_RESETI();
|
||||
//NETLIB_UPDATE_PARAMI();
|
||||
|
@ -270,6 +270,9 @@ void netlist_state_t::compile_defines(std::vector<std::pair<pstring, pstring>> &
|
||||
defs.push_back(ENTRY(HAS_OPENMP));
|
||||
defs.push_back(ENTRY(USE_OPENMP));
|
||||
|
||||
defs.push_back(ENTRY(PPMF_TYPE));
|
||||
defs.push_back(ENTRY(PHAS_PMF_INTERNAL));
|
||||
|
||||
#undef ENTRY
|
||||
}
|
||||
|
||||
@ -474,7 +477,7 @@ void netlist_t::print_stats() const
|
||||
log().verbose("Total time {1:15}", total_time);
|
||||
|
||||
// FIXME: clang complains about unreachable code without
|
||||
if (USE_QUEUE_STATS || (!USE_QUEUE_STATS && m_stats))
|
||||
if (USE_QUEUE_STATS || (USE_QUEUE_STATS && m_stats))
|
||||
{
|
||||
/* Only one serialization should be counted in total time */
|
||||
/* But two are contained in m_stat_mainloop */
|
||||
@ -704,9 +707,7 @@ void detail::net_t::process(const T mask, netlist_sig_t sig)
|
||||
if ((p.terminal_state() & mask))
|
||||
{
|
||||
auto g(stats->m_stat_total_time.guard());
|
||||
//p.device().m_stat_total_time.start();
|
||||
p.m_delegate();
|
||||
//p.device().m_stat_total_time.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -252,10 +252,10 @@ namespace plib {
|
||||
pmfp(MemberFunctionType<O> mftp, O *object)
|
||||
: pmfp_base<R, Targs...>()
|
||||
{
|
||||
this->set(mftp, object);
|
||||
this->set_base(mftp, object);
|
||||
m_obj = reinterpret_cast<generic_class *>(object);
|
||||
}
|
||||
|
||||
|
||||
template<typename O>
|
||||
void set(MemberFunctionType<O> mftp, O *object)
|
||||
{
|
||||
|
@ -7,11 +7,12 @@
|
||||
* - Start2 works (Couriersud)
|
||||
* - Added discrete paddle potentiometers (Couriersud)
|
||||
* - Changes made to run in MAME (Couriersud)
|
||||
* - Added bonus game dip switch (Couriersud)
|
||||
* - Added discrete startup latch
|
||||
* - Original version imported from DICE
|
||||
*
|
||||
* TODO:
|
||||
* - implement discrete startup latch
|
||||
* - implement bonus game dip switch
|
||||
* - lamp triacs?
|
||||
*
|
||||
* The MAME team has asked for and received written confirmation from the
|
||||
* author of DICE to use, modify and redistribute code under:
|
||||
@ -1572,7 +1573,7 @@ CIRCUIT_LAYOUT( breakout )
|
||||
RES(R51, RES_K(3.9))
|
||||
RES(R52, RES_K(3.9))
|
||||
|
||||
#if (SLOW_BUT_ACCURATE)
|
||||
#if (0 && SLOW_BUT_ACCURATE)
|
||||
DIODE(CR6, "1N914")
|
||||
NET_C(E2.11, CR6.K)
|
||||
|
||||
@ -1584,15 +1585,11 @@ CIRCUIT_LAYOUT( breakout )
|
||||
PARAM(CR6.ROFF, 1)
|
||||
NET_C(R41.1, R42.1, R43.1, R51.1, R52.1)
|
||||
#endif
|
||||
#if 1
|
||||
|
||||
CONNECTION("R51", 2, PLAYFIELD)
|
||||
CONNECTION("R43", 2, BSYNC)
|
||||
CONNECTION("R52", 2, SCORE)
|
||||
#else
|
||||
CONNECTION("R51", 2, "V5", Q)
|
||||
CONNECTION("R43", 2, "V5", Q)
|
||||
CONNECTION("R52", 2, "V5", Q)
|
||||
#endif
|
||||
|
||||
NET_C(R41.2, B9.3)
|
||||
NET_C(R42.2, V5)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user