diff --git a/src/emu/netlist/nl_base.c b/src/emu/netlist/nl_base.c index 6a33a6e40b8..5660803d6f8 100644 --- a/src/emu/netlist/nl_base.c +++ b/src/emu/netlist/nl_base.c @@ -552,9 +552,9 @@ ATTR_COLD void netlist_logic_output_t::set_levels(const double low, const double ATTR_COLD double netlist_param_multi_t::dValue(const pstring &entity, const double defval) const { - pstring tmp = this->Value(); //.ucase(); + pstring tmp = this->Value().ucase(); // .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) - int p = tmp.find(entity + "="); + int p = tmp.find(entity.ucase() + "="); if (p>=0) { int pblank = tmp.find(" ", p); diff --git a/src/emu/netlist/pstring.c b/src/emu/netlist/pstring.c index 7b0f3127a3f..4e984cb1359 100644 --- a/src/emu/netlist/pstring.c +++ b/src/emu/netlist/pstring.c @@ -59,6 +59,15 @@ pstring pstring::substr(unsigned int start, int count) const return ret; } +pstring pstring::ucase() const +{ + pstring ret = *this; + ret.pcopy(cstr(), len()); + for (int i=0; im_str[i] = toupper((unsigned) ret.m_ptr->m_str[i]); + return ret; +} + //------------------------------------------------- // pcmpi - compare a character array to an nstring //------------------------------------------------- @@ -101,7 +110,7 @@ void pstring::sfree(str_t *s) pstring::str_t *pstring::salloc(int n) { - str_t *ret = new(m_pool, n) str_t(n); + str_t *ret = new(m_pool, n+1) str_t(n); return ret; } diff --git a/src/emu/netlist/pstring.h b/src/emu/netlist/pstring.h index 5d8c157b36e..f00c44d3c28 100644 --- a/src/emu/netlist/pstring.h +++ b/src/emu/netlist/pstring.h @@ -8,6 +8,7 @@ #define _PSTRING_H_ #include "nl_config.h" +#include // ---------------------------------------------------------------------------------------- // pblockbool: allocate small memory more efficiently at the expense of some overhead @@ -50,6 +51,7 @@ struct pblockpool { inline void *operator new(std::size_t size, pblockpool &pool, int extra = 0) throw (std::bad_alloc) { void *result = pool.alloc(size + extra); + //std::printf("allocating %ld + %d\n", size, extra); if (result == NULL) throw std::bad_alloc(); return result; @@ -133,6 +135,7 @@ public: pstring left(unsigned int count) const { return substr(0, count); } pstring right(unsigned int count) const { return substr(len() - count, count); } + pstring ucase() const; // printf using string as format ... @@ -164,7 +167,9 @@ private: inline void init() { if (m_zero == NULL) + { m_zero = new(pstring::m_pool, 0) pstring::str_t(0); + } m_ptr = m_zero; m_ptr->m_ref_count++; }