From 1415421fd707ad02e0cfddf20bf70bbd045a9203 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 6 Jan 2019 13:17:20 +0100 Subject: More c++ alignment. pstring now behaves like std::string. (nw) This change removes all string extensions like trim, rpad, left, right, ... from pstring and replaces them by function templates. This aligns a lot better with the intentions of the standard library. --- src/lib/netlist/plib/pparser.cpp | 53 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 26 deletions(-) (limited to 'src/lib/netlist/plib/pparser.cpp') diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp index 7547572192d..1a4db5b816c 100644 --- a/src/lib/netlist/plib/pparser.cpp +++ b/src/lib/netlist/plib/pparser.cpp @@ -34,7 +34,7 @@ pstring ptokenizer::currentline_str() void ptokenizer::skipeol() { - pstring::code_t c = getc(); + pstring::value_type c = getc(); while (c) { if (c == 10) @@ -49,11 +49,11 @@ void ptokenizer::skipeol() } -pstring::code_t ptokenizer::getc() +pstring::value_type ptokenizer::getc() { if (m_unget != 0) { - pstring::code_t c = m_unget; + pstring::value_type c = m_unget; m_unget = 0; return c; } @@ -66,11 +66,11 @@ pstring::code_t ptokenizer::getc() return 0; return '\n'; } - pstring::code_t c = *(m_px++); + pstring::value_type c = *(m_px++); return c; } -void ptokenizer::ungetc(pstring::code_t c) +void ptokenizer::ungetc(pstring::value_type c) { m_unget = c; } @@ -129,9 +129,9 @@ double ptokenizer::get_number_double() { error(pfmt("Expected a number, got <{1}>")(tok.str()) ); } - bool err = false; - double ret = tok.str().as_double(&err); - if (err) + double ret = 0.0; + + if (!plib::pstod_ne(tok.str(), ret)) error(pfmt("Expected a number, got <{1}>")(tok.str()) ); return ret; } @@ -143,9 +143,8 @@ long ptokenizer::get_number_long() { error(pfmt("Expected a long int, got <{1}>")(tok.str()) ); } - bool err = false; - long ret = tok.str().as_long(&err); - if (err) + long ret = 0; + if (!plib::pstol_ne(tok.str(), ret)) error(pfmt("Expected a long int, got <{1}>")(tok.str()) ); return ret; } @@ -182,7 +181,7 @@ ptokenizer::token_t ptokenizer::get_token() ptokenizer::token_t ptokenizer::get_token_internal() { /* skip ws */ - pstring::code_t c = getc(); + pstring::value_type c = getc(); while (m_whitespace.find(c) != pstring::npos) { c = getc(); @@ -327,7 +326,7 @@ double ppreprocessor::expr(const std::vector &sexpr, std::size_t &start else { tok=sexpr[start]; - val = tok.as_double(); + val = plib::pstod(tok); start++; } while (start < sexpr.size()) @@ -410,57 +409,59 @@ static pstring catremainder(const std::vector &elems, std::size_t start pstring ppreprocessor::process_line(const pstring &line) { - pstring lt = line.replace_all("\t"," ").trim(); + //pstring lt = plib::trim(plib::replace_all(line, pstring("\t"), pstring(" "))); + pstring a = plib::replace_all(line, pstring("\t"), pstring(" ")); + pstring lt = plib::trim(a); pstring ret; m_lineno++; // FIXME ... revise and extend macro handling - if (lt.startsWith("#")) + if (plib::startsWith(lt, "#")) { std::vector lti(psplit(lt, " ", true)); - if (lti[0].equals("#if")) + if (lti[0] == "#if") { m_level++; std::size_t start = 0; lt = replace_macros(lt); - std::vector t(psplit(lt.substr(3).replace_all(" ",""), m_expr_sep)); + std::vector t(psplit(replace_all(lt.substr(3), pstring(" "), pstring("")), m_expr_sep)); int val = static_cast(expr(t, start, 0)); if (val == 0) m_ifflag |= (1 << m_level); } - else if (lti[0].equals("#ifdef")) + else if (lti[0] == "#ifdef") { m_level++; if (get_define(lti[1]) == nullptr) m_ifflag |= (1 << m_level); } - else if (lti[0].equals("#ifndef")) + else if (lti[0] == "#ifndef") { m_level++; if (get_define(lti[1]) != nullptr) m_ifflag |= (1 << m_level); } - else if (lti[0].equals("#else")) + else if (lti[0] == "#else") { m_ifflag ^= (1 << m_level); } - else if (lti[0].equals("#endif")) + else if (lti[0] == "#endif") { m_ifflag &= ~(1 << m_level); m_level--; } - else if (lti[0].equals("#include")) + else if (lti[0] == "#include") { // ignore } - else if (lti[0].equals("#pragma")) + else if (lti[0] == "#pragma") { - if (m_ifflag == 0 && lti.size() > 3 && lti[1].equals("NETLIST")) + if (m_ifflag == 0 && lti.size() > 3 && lti[1] == "NETLIST") { - if (lti[2].equals("warning")) + if (lti[2] == "warning") error("NETLIST: " + catremainder(lti, 3, " ")); } } - else if (lti[0].equals("#define")) + else if (lti[0] == "#define") { if (m_ifflag == 0) { -- cgit v1.2.3-70-g09d2 From 3c6d9ac9a02d721a3245c1725b29dd6c10ce3ea7 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 6 Jan 2019 20:04:39 +0100 Subject: Code maintenance and fix for "pure virtual call" error. (nw) --- src/devices/machine/netlist.cpp | 2 ++ src/lib/netlist/nl_base.cpp | 7 +++++-- src/lib/netlist/nl_base.h | 8 ++++++++ src/lib/netlist/nl_errstr.h | 3 ++- src/lib/netlist/nl_setup.cpp | 21 +++++++++++---------- src/lib/netlist/nl_setup.h | 3 ++- src/lib/netlist/plib/pparser.cpp | 18 ++++-------------- src/lib/netlist/prg/nltool.cpp | 1 + 8 files changed, 35 insertions(+), 28 deletions(-) (limited to 'src/lib/netlist/plib/pparser.cpp') diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp index f6167cbd466..15a096a6536 100644 --- a/src/devices/machine/netlist.cpp +++ b/src/devices/machine/netlist.cpp @@ -837,6 +837,8 @@ void netlist_mame_device::device_start() m_netlist = global_alloc(netlist_mame_t(*this, "netlist")); + m_netlist->load_base_libraries(); + // register additional devices nl_register_devices(); diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index 12ccabfd4ab..d984285b000 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -253,8 +253,6 @@ netlist_t::netlist_t(const pstring &aname) state().save_item(this, static_cast(m_queue), "m_queue"); state().save_item(this, m_time, "m_time"); m_setup = plib::make_unique(*this); - /* FIXME: doesn't really belong here */ - NETLIST_NAME(base)(*m_setup); } netlist_t::~netlist_t() @@ -263,6 +261,11 @@ netlist_t::~netlist_t() m_devices.clear(); } +void netlist_t::load_base_libraries() +{ + NETLIST_NAME(base)(*m_setup); +} + nl_double netlist_t::gmin() const NL_NOEXCEPT { return solver()->gmin(); diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index 175c5218193..60294afedc8 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -1222,6 +1222,14 @@ namespace netlist explicit netlist_t(const pstring &aname); virtual ~netlist_t(); + /** + * @brief Load base libraries for diodes, transistors ... + * + * This must be called after netlist_t is created. + * + */ + void load_base_libraries(); + /* run functions */ const netlist_time &time() const NL_NOEXCEPT { return m_time; } diff --git a/src/lib/netlist/nl_errstr.h b/src/lib/netlist/nl_errstr.h index 35b1e4f6c60..d3f62f9e790 100644 --- a/src/lib/netlist/nl_errstr.h +++ b/src/lib/netlist/nl_errstr.h @@ -58,7 +58,8 @@ //#define MF_1_CLASS_1_NOT_FOUND "Class {1} not found!" #define MF_1_UNABLE_TO_PARSE_MODEL_1 "Unable to parse model: {1}" #define MF_1_MODEL_ALREADY_EXISTS_1 "Model already exists: {1}" -#define MF_1_ADDING_ALI1_TO_ALIAS_LIST "Error adding alias {1} to alias list" +#define MF_1_DEVICE_ALREADY_EXISTS_1 "Device already exists: {1}" +#define MF_1_ADDING_ALI1_TO_ALIAS_LIST "Error adding alias {1} to alias list" #define MF_1_DIP_PINS_MUST_BE_AN_EQUAL_NUMBER_OF_PINS_1 "You must pass an equal number of pins to DIPPINS {1}" #define MF_1_UNKNOWN_OBJECT_TYPE_1 "Unknown object type {1}" #define MF_2_INVALID_NUMBER_CONVERSION_1_2 "Invalid number conversion {1} : {2}" diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp index fb4cc424147..c8e47cb17e3 100644 --- a/src/lib/netlist/nl_setup.cpp +++ b/src/lib/netlist/nl_setup.cpp @@ -78,17 +78,15 @@ void setup_t::register_dev(const pstring &classname, const pstring &name) log().fatal(MF_1_CLASS_1_NOT_FOUND, classname); /* make sure we parse macro library entries */ f->macro_actions(netlist(), name); - m_device_factory.push_back(std::pair(build_fqn(name), f)); + pstring key = build_fqn(name); + if (device_exists(key)) + log().fatal(MF_1_DEVICE_ALREADY_EXISTS_1, name); + m_device_factory[key] = f; } bool setup_t::device_exists(const pstring &name) const { - for (auto e : m_device_factory) - { - if (e.first == name) - return true; - } - return false; + return (m_device_factory.find(name) != m_device_factory.end()); } @@ -160,7 +158,7 @@ double setup_t::get_initial_param_val(const pstring &name, const double def) if (i != m_param_values.end()) { double vald = 0; - if (sscanf(i->second.c_str(), "%lf", &vald) != 1) + if (!plib::pstod_ne(i->second, vald)) log().fatal(MF_2_INVALID_NUMBER_CONVERSION_1_2, name, i->second); return vald; } @@ -173,9 +171,12 @@ int setup_t::get_initial_param_val(const pstring &name, const int def) auto i = m_param_values.find(name); if (i != m_param_values.end()) { - double vald = 0; - if (sscanf(i->second.c_str(), "%lf", &vald) != 1) + long vald = 0; + if (!plib::pstod_ne(i->second, vald)) log().fatal(MF_2_INVALID_NUMBER_CONVERSION_1_2, name, i->second); + if (vald - std::floor(vald) != 0.0) + log().fatal(MF_2_INVALID_NUMBER_CONVERSION_1_2, name, i->second); + return static_cast(vald); } else diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h index 1d84585236d..4f7146b3995 100644 --- a/src/lib/netlist/nl_setup.h +++ b/src/lib/netlist/nl_setup.h @@ -291,7 +291,8 @@ namespace netlist plib::plog_base &log(); const plib::plog_base &log() const; - std::vector> m_device_factory; + //std::vector> m_device_factory; + std::unordered_map m_device_factory; std::unordered_map m_alias; std::unordered_map m_param_values; diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp index 1a4db5b816c..298fa589fba 100644 --- a/src/lib/netlist/plib/pparser.cpp +++ b/src/lib/netlist/plib/pparser.cpp @@ -375,10 +375,7 @@ double ppreprocessor::expr(const std::vector &sexpr, std::size_t &start ppreprocessor::define_t *ppreprocessor::get_define(const pstring &name) { auto idx = m_defines.find(name); - if (idx != m_defines.end()) - return &idx->second; - else - return nullptr; + return (idx != m_defines.end()) ? &idx->second : nullptr; } pstring ppreprocessor::replace_macros(const pstring &line) @@ -388,10 +385,7 @@ pstring ppreprocessor::replace_macros(const pstring &line) for (auto & elem : elems) { define_t *def = get_define(elem); - if (def != nullptr) - ret += def->m_replace; - else - ret += elem; + ret += (def != nullptr) ? def->m_replace : elem; } return ret; } @@ -409,11 +403,8 @@ static pstring catremainder(const std::vector &elems, std::size_t start pstring ppreprocessor::process_line(const pstring &line) { - //pstring lt = plib::trim(plib::replace_all(line, pstring("\t"), pstring(" "))); - pstring a = plib::replace_all(line, pstring("\t"), pstring(" ")); - pstring lt = plib::trim(a); + pstring lt = plib::trim(plib::replace_all(line, pstring("\t"), pstring(" "))); pstring ret; - m_lineno++; // FIXME ... revise and extend macro handling if (plib::startsWith(lt, "#")) { @@ -477,9 +468,7 @@ pstring ppreprocessor::process_line(const pstring &line) { lt = replace_macros(lt); if (m_ifflag == 0) - { ret += lt; - } } return ret; } @@ -490,6 +479,7 @@ void ppreprocessor::process(putf8_reader &istrm, putf8_writer &ostrm) pstring line; while (istrm.readline(line)) { + m_lineno++; line = process_line(line); ostrm.writeline(line); } diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index 52ad8d3f55c..4fcb4ebdc30 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -147,6 +147,7 @@ public: void init() { + load_base_libraries(); } void read_netlist(const pstring &filename, const pstring &name, -- cgit v1.2.3-70-g09d2 From 4213a396d8652e7ea26c07c133932bd9f5a87faa Mon Sep 17 00:00:00 2001 From: couriersud Date: Thu, 10 Jan 2019 00:30:51 +0100 Subject: Improve type safety on string->numeric conversions. (nw) Also fixed an issue with 7497. ./nltool -t 5 -f src/mame/machine/nl_tp1983.cpp -v now runs again. --- src/lib/netlist/devices/net_lib.cpp | 2 +- src/lib/netlist/devices/nlid_system.h | 4 +- src/lib/netlist/devices/nlid_truthtable.cpp | 3 +- src/lib/netlist/nl_base.cpp | 4 +- src/lib/netlist/nl_config.h | 1 - src/lib/netlist/nl_parser.cpp | 8 +-- src/lib/netlist/nl_setup.cpp | 13 +++-- src/lib/netlist/plib/pfunction.cpp | 4 +- src/lib/netlist/plib/poptions.cpp | 40 +------------ src/lib/netlist/plib/poptions.h | 91 ++++++++++++++++++++--------- src/lib/netlist/plib/pparser.cpp | 15 +++-- src/lib/netlist/plib/pstring.h | 77 ++++++++++++++---------- src/lib/netlist/plib/putil.cpp | 30 ++++++++++ src/lib/netlist/plib/putil.h | 5 ++ src/lib/netlist/prg/nltool.cpp | 18 +++--- src/lib/netlist/prg/nlwav.cpp | 4 +- src/lib/netlist/solver/nld_solver.cpp | 2 +- src/lib/netlist/tools/nl_convert.cpp | 9 +-- 18 files changed, 197 insertions(+), 133 deletions(-) (limited to 'src/lib/netlist/plib/pparser.cpp') diff --git a/src/lib/netlist/devices/net_lib.cpp b/src/lib/netlist/devices/net_lib.cpp index 30ddf3af84c..dd77be5a9a2 100644 --- a/src/lib/netlist/devices/net_lib.cpp +++ b/src/lib/netlist/devices/net_lib.cpp @@ -74,7 +74,7 @@ namespace netlist ENTRYX(7485, TTL_7485, "+A0,+A1,+A2,+A3,+B0,+B1,+B2,+B3,+LTIN,+EQIN,+GTIN") ENTRYX(7490, TTL_7490, "+A,+B,+R1,+R2,+R91,+R92") ENTRYX(7493, TTL_7493, "+CLKA,+CLKB,+R1,+R2") - ENTRYX(7497, TTL_7497, "+CLK,+STRB,+EN,+UNITY,+CLR,+B0,+B1,+B2,+B3,+B4,+B5") + ENTRYX(7497, TTL_7497, "+CLK,+STRBQ,+ENQ,+UNITYQ,+CLR,+B0,+B1,+B2,+B3,+B4,+B5") ENTRYX(74107, TTL_74107, "+CLK,+J,+K,+CLRQ") ENTRYX(74107A, TTL_74107A, "+CLK,+J,+K,+CLRQ") ENTRYX(74123, TTL_74123, "") diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h index 881cce03592..5a874aef3df 100644 --- a/src/lib/netlist/devices/nlid_system.h +++ b/src/lib/netlist/devices/nlid_system.h @@ -136,7 +136,9 @@ namespace netlist unsigned long total = 0; for (unsigned i=0; i(plib::pstol(pat[i])); + // FIXME: use pstonum_ne + //pati[i] = plib::pstonum(pat[i]); + pati[i] = plib::pstonum(pat[i]); total += pati[i]; } netlist_time ttotal = netlist_time::zero(); diff --git a/src/lib/netlist/devices/nlid_truthtable.cpp b/src/lib/netlist/devices/nlid_truthtable.cpp index c3449d5b604..dbb9401425d 100644 --- a/src/lib/netlist/devices/nlid_truthtable.cpp +++ b/src/lib/netlist/devices/nlid_truthtable.cpp @@ -407,7 +407,8 @@ void truthtable_parser::parse(const std::vector &truthtable) val.set(j); else nl_assert_always(outs == "0", "Unknown value (not 0 or 1"); - netlist_time t = netlist_time::from_nsec(static_cast(plib::pstol(plib::trim(times[j])))); + // FIXME: error handling + netlist_time t = netlist_time::from_nsec(plib::pstonum(plib::trim(times[j]))); uint_least8_t k=0; while (m_timing_nt[k] != netlist_time::zero() && m_timing_nt[k] != t) k++; diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index 5b132ebd554..a0eabcc7fbe 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -343,8 +343,8 @@ void netlist_t::start() auto p = setup().m_param_values.find(d->name() + ".HINT_NO_DEACTIVATE"); if (p != setup().m_param_values.end()) { - //FIXME: turn this into a proper function - auto v = plib::pstod(p->second);; + //FIXME: check for errors ... + double v = plib::pstonum(p->second);; if (std::abs(v - std::floor(v)) > 1e-6 ) log().fatal(MF_1_HND_VAL_NOT_SUPPORTED, p->second); d->set_hint_deactivate(v == 0.0); diff --git a/src/lib/netlist/nl_config.h b/src/lib/netlist/nl_config.h index d2f4dc75511..20ddf5c71a3 100644 --- a/src/lib/netlist/nl_config.h +++ b/src/lib/netlist/nl_config.h @@ -26,7 +26,6 @@ * linear memory pool. This is based of the assumption that * due to enhanced locality there will be less cache misses. * Your mileage may vary. - * This will cause crashes on OSX and thus is ignored on OSX. * */ #define USE_MEMPOOL (0) diff --git a/src/lib/netlist/nl_parser.cpp b/src/lib/netlist/nl_parser.cpp index a6a805826ce..1ff6ef6c6b7 100644 --- a/src/lib/netlist/nl_parser.cpp +++ b/src/lib/netlist/nl_parser.cpp @@ -403,7 +403,6 @@ nl_double parser_t::eval_param(const token_t tok) int i; int f=0; nl_double ret; - pstring val; for (i=1; i<6;i++) if (tok.str() == macs[i]) @@ -416,9 +415,10 @@ nl_double parser_t::eval_param(const token_t tok) } else { - val = tok.str(); - if (!plib::pstod_ne(val, ret)) - error(plib::pfmt("Parameter value <{1}> not double \n")(val)); + bool err; + ret = plib::pstonum_ne(tok.str(), err); + if (err) + error(plib::pfmt("Parameter value <{1}> not double \n")(tok.str())); } return ret * facs[f]; diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp index cf89e4a8fae..28385d984cf 100644 --- a/src/lib/netlist/nl_setup.cpp +++ b/src/lib/netlist/nl_setup.cpp @@ -159,8 +159,9 @@ double setup_t::get_initial_param_val(const pstring &name, const double def) auto i = m_param_values.find(name); if (i != m_param_values.end()) { - double vald = 0; - if (!plib::pstod_ne(i->second, vald)) + bool err = false; + double vald = plib::pstonum_ne(i->second, err); + if (err) log().fatal(MF_2_INVALID_NUMBER_CONVERSION_1_2, name, i->second); return vald; } @@ -173,8 +174,9 @@ int setup_t::get_initial_param_val(const pstring &name, const int def) auto i = m_param_values.find(name); if (i != m_param_values.end()) { - long vald = 0; - if (!plib::pstod_ne(i->second, vald)) + bool err; + double vald = plib::pstonum_ne(i->second, err); + if (err) log().fatal(MF_2_INVALID_NUMBER_CONVERSION_1_2, name, i->second); if (vald - std::floor(vald) != 0.0) log().fatal(MF_2_INVALID_NUMBER_CONVERSION_1_2, name, i->second); @@ -872,7 +874,8 @@ nl_double setup_t::model_value(detail::model_map_t &map, const pstring &entity) } if (factor != NL_FCONST(1.0)) tmp = plib::left(tmp, tmp.size() - 1); - return plib::pstod(tmp) * factor; + // FIXME: check for errors + return plib::pstonum(tmp) * factor; } class logic_family_std_proxy_t : public logic_family_desc_t diff --git a/src/lib/netlist/plib/pfunction.cpp b/src/lib/netlist/plib/pfunction.cpp index e9e2de009c8..f2ef3522813 100644 --- a/src/lib/netlist/plib/pfunction.cpp +++ b/src/lib/netlist/plib/pfunction.cpp @@ -69,7 +69,9 @@ void pfunction::compile_postfix(const std::vector &inputs, if (rc.m_cmd != PUSH_INPUT) { rc.m_cmd = PUSH_CONST; - if (!plib::pstod_ne(cmd, rc.m_param)) + bool err; + rc.m_param = plib::pstonum_ne(cmd, err); + if (err) throw plib::pexception(plib::pfmt("nld_function: unknown/misformatted token <{1}> in <{2}>")(cmd)(expr)); stk += 1; } diff --git a/src/lib/netlist/plib/poptions.cpp b/src/lib/netlist/plib/poptions.cpp index d576eff0bb2..c790d1f55af 100644 --- a/src/lib/netlist/plib/poptions.cpp +++ b/src/lib/netlist/plib/poptions.cpp @@ -46,49 +46,13 @@ namespace plib { return 0; } - int option_str_limit::parse(const pstring &argument) - { - if (plib::container::contains(m_limit, argument)) - { - m_val = argument; - return 0; - } - else - return 1; - } - int option_bool::parse(const pstring &argument) { + unused_var(argument); m_val = true; return 0; } - int option_double::parse(const pstring &argument) - { - try - { - m_val = plib::pstod(argument); - return 0; - } - catch (...) - { - return 1; - } - } - - int option_long::parse(const pstring &argument) - { - try - { - m_val = plib::pstol(argument); - return 0; - } - catch (...) - { - return 1; - } - } - int option_vec::parse(const pstring &argument) { bool err = false; @@ -233,7 +197,7 @@ namespace plib { if (opt->has_argument()) { line += "="; - option_str_limit *ol = dynamic_cast(opt); + option_str_limit_base *ol = dynamic_cast(opt); if (ol) { for (auto &v : ol->limit()) diff --git a/src/lib/netlist/plib/poptions.h b/src/lib/netlist/plib/poptions.h index 491ac0b4d91..f3be4b061dd 100644 --- a/src/lib/netlist/plib/poptions.h +++ b/src/lib/netlist/plib/poptions.h @@ -102,72 +102,98 @@ private: pstring m_val; }; -class option_str_limit : public option +class option_str_limit_base : public option { public: - option_str_limit(options &parent, pstring ashort, pstring along, pstring defval, pstring limit, pstring help) - : option(parent, ashort, along, help, true), m_val(defval) - , m_limit(plib::psplit(limit, ":")) + option_str_limit_base(options &parent, pstring ashort, pstring along, std::vector &&limit, pstring help) + : option(parent, ashort, along, help, true) + , m_limit(limit) { } - - pstring operator ()() { return m_val; } - const std::vector &limit() { return m_limit; } + const std::vector &limit() const { return m_limit; } protected: - virtual int parse(const pstring &argument) override; private: - pstring m_val; std::vector m_limit; }; -class option_bool : public option + +template +class option_str_limit : public option_str_limit_base { public: - option_bool(options &parent, pstring ashort, pstring along, pstring help) - : option(parent, ashort, along, help, false), m_val(false) - {} + option_str_limit(options &parent, pstring ashort, pstring along, const T &defval, std::vector &&limit, pstring help) + : option_str_limit_base(parent, ashort, along, std::move(limit), help), m_val(defval) + { + } - bool operator ()() { return m_val; } + T operator ()() { return m_val; } + + pstring as_string() const { return limit()[m_val]; } protected: - virtual int parse(const pstring &argument) override; + virtual int parse(const pstring &argument) override + { + auto raw = plib::container::indexof(limit(), argument); + + if (raw != plib::container::npos) + { + m_val = static_cast(raw); + return 0; + } + else + return 1; + } private: - bool m_val; + T m_val; }; -class option_double : public option +class option_bool : public option { public: - option_double(options &parent, pstring ashort, pstring along, double defval, pstring help) - : option(parent, ashort, along, help, true), m_val(defval) + option_bool(options &parent, pstring ashort, pstring along, pstring help) + : option(parent, ashort, along, help, false), m_val(false) {} - double operator ()() { return m_val; } + bool operator ()() { return m_val; } protected: virtual int parse(const pstring &argument) override; private: - double m_val; + bool m_val; }; -class option_long : public option +template +class option_num : public option { public: - option_long(options &parent, pstring ashort, pstring along, long defval, pstring help) - : option(parent, ashort, along, help, true), m_val(defval) + option_num(options &parent, pstring ashort, pstring along, T defval, + pstring help, + T minval = std::numeric_limits::min(), + T maxval = std::numeric_limits::max() ) + : option(parent, ashort, along, help, true) + , m_val(defval) + , m_min(minval) + , m_max(maxval) {} - long operator ()() { return m_val; } + T operator ()() { return m_val; } protected: - virtual int parse(const pstring &argument) override; + virtual int parse(const pstring &argument) override + { + bool err; + m_val = pstonum_ne(argument, err); + return (err ? 1 : (m_val < m_min || m_val > m_max)); + } private: - long m_val; + T m_val; + T m_min; + T m_max; }; class option_vec : public option @@ -207,6 +233,17 @@ private: static pstring split_paragraphs(pstring text, unsigned width, unsigned indent, unsigned firstline_indent); + template + T *getopt_type() + { + for (auto & optbase : m_opts ) + { + if (auto opt = dynamic_cast(optbase)) + return opt; + } + return nullptr; + } + option *getopt_short(pstring arg); option *getopt_long(pstring arg); diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp index 298fa589fba..b18b3265440 100644 --- a/src/lib/netlist/plib/pparser.cpp +++ b/src/lib/netlist/plib/pparser.cpp @@ -122,6 +122,7 @@ pstring ptokenizer::get_identifier_or_number() return tok.str(); } +// FIXME: combine into template double ptokenizer::get_number_double() { token_t tok = get_token(); @@ -129,9 +130,9 @@ double ptokenizer::get_number_double() { error(pfmt("Expected a number, got <{1}>")(tok.str()) ); } - double ret = 0.0; - - if (!plib::pstod_ne(tok.str(), ret)) + bool err; + double ret = plib::pstonum_ne(tok.str(), err); + if (err) error(pfmt("Expected a number, got <{1}>")(tok.str()) ); return ret; } @@ -143,8 +144,9 @@ long ptokenizer::get_number_long() { error(pfmt("Expected a long int, got <{1}>")(tok.str()) ); } - long ret = 0; - if (!plib::pstol_ne(tok.str(), ret)) + bool err; + long ret = plib::pstonum_ne(tok.str(), err); + if (err) error(pfmt("Expected a long int, got <{1}>")(tok.str()) ); return ret; } @@ -326,7 +328,8 @@ double ppreprocessor::expr(const std::vector &sexpr, std::size_t &start else { tok=sexpr[start]; - val = plib::pstod(tok); + // FIXME: error handling + val = plib::pstonum(tok); start++; } while (start < sexpr.size()) diff --git a/src/lib/netlist/plib/pstring.h b/src/lib/netlist/plib/pstring.h index 67104a54213..677ce9e43b8 100644 --- a/src/lib/netlist/plib/pstring.h +++ b/src/lib/netlist/plib/pstring.h @@ -9,8 +9,10 @@ #include #include +#include #include #include +#include #include // ---------------------------------------------------------------------------------------- @@ -518,57 +520,72 @@ namespace plib return pwstring(std::to_wstring(v)); } -#if (PSTRING_USE_STD_STRING) - inline double pstod(const std::string &str, std::size_t *e = nullptr) - { - return std::stod(str, e); - } + template + struct pstonum_helper; - inline long pstol(const std::string &str, std::size_t *e = nullptr, int base = 10) + template + struct pstonum_helper::value + && std::is_signed::value>::type> { - return std::stol(str, e, base); - } -#else + template + long long operator()(const S &arg, std::size_t *idx) + { + return std::stoll(arg, idx); + } + }; + template - double pstod(const T &str, std::size_t *e = nullptr) + struct pstonum_helper::value + && !std::is_signed::value>::type> { - return std::stod(str.cpp_string(), e); - } + template + unsigned long long operator()(const S &arg, std::size_t *idx) + { + return std::stoull(arg, idx); + } + }; template - long pstol(const T &str, std::size_t *e = nullptr, int base = 10) + struct pstonum_helper::value>::type> { - return std::stol(str.cpp_string(), e, base); - } -#endif + template + long double operator()(const S &arg, std::size_t *idx) + { + return std::stold(arg, idx); + } + }; - template - bool pstol_ne(const T &str, R &ret) + template + T pstonum(const S &arg) { - try + decltype(arg.c_str()) cstr = arg.c_str(); + std::size_t idx(0); + auto ret = pstonum_helper()(cstr, &idx); + if (ret >= std::numeric_limits::lowest() && ret <= std::numeric_limits::max()) + //&& (ret == T(0) || std::abs(ret) >= std::numeric_limits::min() )) { - std::size_t e = 0; - ret = pstol(str, &e); - return str.c_str()[e] == 0; + if (cstr[idx] != 0) + throw std::invalid_argument(std::string("Continuation after numeric value ends: ") + cstr); } - catch (...) + else { - return false; + throw std::out_of_range(std::string("Out of range: ") + cstr); } + return static_cast(ret); } - template - bool pstod_ne(const T &str, R &ret) + template + R pstonum_ne(const T &str, bool &err) noexcept { try { - std::size_t e = 0; - ret = pstod(str, &e); - return str.c_str()[e] == 0; + err = false; + return pstonum(str); } catch (...) { - return false; + err = true; + return R(0); } } diff --git a/src/lib/netlist/plib/putil.cpp b/src/lib/netlist/plib/putil.cpp index 0d3a0ebca3f..92e0e6b3ab1 100644 --- a/src/lib/netlist/plib/putil.cpp +++ b/src/lib/netlist/plib/putil.cpp @@ -64,6 +64,36 @@ namespace plib return ret; } + std::vector psplit_r(const std::string &stri, + const std::string &token, + const std::size_t maxsplit) + { + std::string str(stri); + std::vector result; + std::size_t splits = 0; + + while(str.size()) + { + std::size_t index = str.rfind(token); + bool found = index!=std::string::npos; + if (found) + splits++; + if ((splits <= maxsplit || maxsplit == 0) && found) + { + result.push_back(str.substr(index+token.size())); + str = str.substr(0, index); + if (str.size()==0) + result.push_back(str); + } + else + { + result.push_back(str); + str = ""; + } + } + return result; + } + std::vector psplit(const pstring &str, const std::vector &onstrl) { pstring col = ""; diff --git a/src/lib/netlist/plib/putil.h b/src/lib/netlist/plib/putil.h index 8d59c0357e2..914d9820560 100644 --- a/src/lib/netlist/plib/putil.h +++ b/src/lib/netlist/plib/putil.h @@ -16,6 +16,11 @@ namespace plib { + + // Avoid unused variable warnings + template + inline void unused_var(Ts&&...) {} + namespace util { const pstring buildpath(std::initializer_list list ); diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index 4fcb4ebdc30..4395bd3bd17 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -23,7 +23,7 @@ public: tool_app_t() : plib::app(), opt_grp1(*this, "General options", "The following options apply to all commands."), - opt_cmd (*this, "c", "cmd", "run", "run:convert:listdevices:static:header:docheader", "run|convert|listdevices|static|header"), + opt_cmd (*this, "c", "cmd", 0, std::vector({"run","convert","listdevices","static","header","docheader"}), "run|convert|listdevices|static|header|docheader"), opt_file(*this, "f", "file", "-", "file to process (default is stdin)"), opt_defines(*this, "D", "define", "predefine value as macro, e.g. -Dname=value. If '=value' is omitted predefine it as 1. This option may be specified repeatedly."), opt_rfolders(*this, "r", "rom", "where to look for data files"), @@ -40,7 +40,7 @@ public: opt_loadstate(*this,"", "loadstate", "", "load state from file and continue from there"), opt_savestate(*this,"", "savestate", "", "save state to file at end of run"), opt_grp4(*this, "Options for convert command", "These options are only used by the convert command."), - opt_type(*this, "y", "type", "spice", "spice:eagle:rinf", "type of file to be converted: spice,eagle,rinf"), + opt_type(*this, "y", "type", 0, std::vector({"spice","eagle","rinf"}), "type of file to be converted: spice,eagle,rinf"), opt_ex1(*this, "nltool -c run -t 3.5 -f nl_examples/cdelay.c -n cap_delay", "Run netlist \"cap_delay\" from file nl_examples/cdelay.c for 3.5 seconds"), @@ -49,7 +49,7 @@ public: {} plib::option_group opt_grp1; - plib::option_str_limit opt_cmd; + plib::option_str_limit opt_cmd; plib::option_str opt_file; plib::option_vec opt_defines; plib::option_vec opt_rfolders; @@ -60,13 +60,13 @@ public: plib::option_group opt_grp2; plib::option_str opt_name; plib::option_group opt_grp3; - plib::option_double opt_ttr; + plib::option_num opt_ttr; plib::option_vec opt_logs; plib::option_str opt_inp; plib::option_str opt_loadstate; plib::option_str opt_savestate; plib::option_group opt_grp4; - plib::option_str_limit opt_type; + plib::option_str_limit opt_type; plib::option_example opt_ex1; plib::option_example opt_ex2; @@ -706,7 +706,7 @@ int tool_app_t::execute() try { - pstring cmd = opt_cmd(); + pstring cmd = opt_cmd.as_string(); if (cmd == "listdevices") listdevices(); else if (cmd == "run") @@ -734,19 +734,19 @@ int tool_app_t::execute() contents = ostrm.str(); pstring result; - if (opt_type() == "spice") + if (opt_type.as_string() == "spice") { nl_convert_spice_t c; c.convert(contents); result = c.result(); } - else if (opt_type() == "eagle") + else if (opt_type.as_string() == "eagle") { nl_convert_eagle_t c; c.convert(contents); result = c.result(); } - else if (opt_type() == "rinf") + else if (opt_type.as_string() == "rinf") { nl_convert_rinf_t c; c.convert(contents); diff --git a/src/lib/netlist/prg/nlwav.cpp b/src/lib/netlist/prg/nlwav.cpp index 23491e88349..a1f14692364 100644 --- a/src/lib/netlist/prg/nlwav.cpp +++ b/src/lib/netlist/prg/nlwav.cpp @@ -24,8 +24,8 @@ public: {} plib::option_str opt_inp; plib::option_str opt_out; - plib::option_double opt_amp; - plib::option_long opt_rate; + plib::option_num opt_amp; + plib::option_num opt_rate; plib::option_bool opt_verb; plib::option_bool opt_quiet; plib::option_bool opt_version; diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp index 2158d725694..ad62ba17c28 100644 --- a/src/lib/netlist/solver/nld_solver.cpp +++ b/src/lib/netlist/solver/nld_solver.cpp @@ -268,7 +268,7 @@ void NETLIB_NAME(solver)::post_start() // Override log statistics pstring p = plib::util::environment("NL_STATS", ""); if (p != "") - m_params.m_log_stats = plib::pstol(p); + m_params.m_log_stats = plib::pstonum(p); else m_params.m_log_stats = m_log_stats(); diff --git a/src/lib/netlist/tools/nl_convert.cpp b/src/lib/netlist/tools/nl_convert.cpp index aff7d0da81b..4488396a131 100644 --- a/src/lib/netlist/tools/nl_convert.cpp +++ b/src/lib/netlist/tools/nl_convert.cpp @@ -214,7 +214,7 @@ double nl_convert_base_t::get_sp_val(const pstring &sin) ++p; pstring val = plib::left(sin, p); pstring unit = sin.substr(p); - double ret = get_sp_unit(unit) * plib::pstod(val); + double ret = get_sp_unit(unit) * plib::pstonum(val); return ret; } @@ -304,11 +304,12 @@ void nl_convert_spice_t::process_line(const pstring &line) /* check for fourth terminal ... should be numeric net * including "0" or start with "N" (ltspice) */ - long nval = 0; pstring model; pstring pins ="CBE"; + bool err; + ATTR_UNUSED long nval = plib::pstonum_ne(tt[4], err); - if ((!plib::pstol_ne(tt[4], nval) || plib::startsWith(tt[4], "N")) && tt.size() > 5) + if ((err || plib::startsWith(tt[4], "N")) && tt.size() > 5) model = tt[5]; else model = tt[4]; @@ -492,7 +493,7 @@ void nl_convert_eagle_t::convert(const pstring &contents) else if (plib::ucase(sval) == "LOW") add_device("TTL_INPUT", name, 0); else - add_device("ANALOG_INPUT", name, plib::pstod(sval)); + add_device("ANALOG_INPUT", name, plib::pstonum(sval)); add_pin_alias(name, "1", "Q"); break; case 'D': -- cgit v1.2.3-70-g09d2 From 633528eb31e7f318e6934476c85126dcf02fd457 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 13 Jan 2019 00:08:47 +0100 Subject: Improve dealing ownership in pstreams. (nw) I am not really happy with this. But I am missing some creativity currently. --- src/lib/netlist/devices/nld_log.cpp | 4 +- src/lib/netlist/nl_parser.h | 4 +- src/lib/netlist/nl_setup.cpp | 14 +-- src/lib/netlist/nl_setup.h | 2 +- src/lib/netlist/plib/pmain.cpp | 4 +- src/lib/netlist/plib/pparser.cpp | 4 +- src/lib/netlist/plib/pparser.h | 4 +- src/lib/netlist/plib/pstream.cpp | 29 ++--- src/lib/netlist/plib/pstream.h | 210 +++++++++++++++++++++++++++++------ src/lib/netlist/plib/pstring.h | 2 + src/lib/netlist/prg/nltool.cpp | 9 +- src/lib/netlist/prg/nlwav.cpp | 27 +++-- src/lib/netlist/solver/nld_ms_gcr.h | 4 +- src/lib/netlist/tools/nl_convert.cpp | 22 ++-- src/lib/netlist/tools/nl_convert.h | 4 +- 15 files changed, 239 insertions(+), 104 deletions(-) (limited to 'src/lib/netlist/plib/pparser.cpp') diff --git a/src/lib/netlist/devices/nld_log.cpp b/src/lib/netlist/devices/nld_log.cpp index 8125dacafe8..1d3ea7b1b75 100644 --- a/src/lib/netlist/devices/nld_log.cpp +++ b/src/lib/netlist/devices/nld_log.cpp @@ -19,8 +19,8 @@ namespace netlist { NETLIB_CONSTRUCTOR(log) , m_I(*this, "I") - , m_strm(plib::pfmt("{1}.log")(this->name())) - , m_writer(m_strm) + , m_strm(pstring(plib::pfmt("{1}.log")(this->name()))) + , m_writer(&m_strm) { } diff --git a/src/lib/netlist/nl_parser.h b/src/lib/netlist/nl_parser.h index a813629faa0..872cfa11954 100644 --- a/src/lib/netlist/nl_parser.h +++ b/src/lib/netlist/nl_parser.h @@ -16,8 +16,8 @@ namespace netlist class parser_t : public plib::ptokenizer { public: - parser_t(plib::putf8_reader &strm, setup_t &setup) - : plib::ptokenizer(strm), m_setup(setup) {} + parser_t(plib::putf8_reader &&strm, setup_t &setup) + : plib::ptokenizer(std::move(strm)), m_setup(setup) {} bool parse(const pstring &nlname = ""); diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp index 28385d984cf..a02d5f5bbae 100644 --- a/src/lib/netlist/nl_setup.cpp +++ b/src/lib/netlist/nl_setup.cpp @@ -965,15 +965,15 @@ std::unique_ptr setup_t::get_data_stream(const pstring &name) } -bool setup_t::parse_stream(plib::putf8_reader &istrm, const pstring &name) +bool setup_t::parse_stream(plib::putf8_reader &&istrm, const pstring &name) { plib::pomemstream ostrm; - plib::putf8_writer owrt(ostrm); + plib::putf8_writer owrt(&ostrm); plib::ppreprocessor(&m_defines).process(istrm, owrt); - plib::pimemstream istrm2(ostrm); - plib::putf8_reader reader2(istrm2); - return parser_t(reader2, *this).parse(name); + plib::putf8_reader reader2 = plib::putf8_reader(plib::pimemstream(ostrm)); + + return parser_t(std::move(reader2), *this).parse(name); } void setup_t::register_define(const pstring &defstr) @@ -996,8 +996,8 @@ bool source_t::parse(const pstring &name) else { auto rstream = stream(name); - plib::putf8_reader reader(*rstream); - return m_setup.parse_stream(reader, name); + plib::putf8_reader reader(rstream.get()); + return m_setup.parse_stream(std::move(reader), name); } } diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h index 4f7146b3995..cae829023a4 100644 --- a/src/lib/netlist/nl_setup.h +++ b/src/lib/netlist/nl_setup.h @@ -259,7 +259,7 @@ namespace netlist std::unique_ptr get_data_stream(const pstring &name); - bool parse_stream(plib::putf8_reader &istrm, const pstring &name); + bool parse_stream(plib::putf8_reader &&istrm, const pstring &name); /* register a source */ diff --git a/src/lib/netlist/plib/pmain.cpp b/src/lib/netlist/plib/pmain.cpp index 6edfe86b838..30b4a1948bd 100644 --- a/src/lib/netlist/plib/pmain.cpp +++ b/src/lib/netlist/plib/pmain.cpp @@ -37,8 +37,8 @@ namespace plib { : options() , pout_strm() , perr_strm() - , pout(pout_strm) - , perr(perr_strm) + , pout(&pout_strm) + , perr(&perr_strm) { } diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp index b18b3265440..2d1a426f5a5 100644 --- a/src/lib/netlist/plib/pparser.cpp +++ b/src/lib/netlist/plib/pparser.cpp @@ -16,8 +16,8 @@ namespace plib { // A simple tokenizer // ---------------------------------------------------------------------------------------- -ptokenizer::ptokenizer(plib::putf8_reader &strm) -: m_strm(strm), m_lineno(0), m_cur_line(""), m_px(m_cur_line.begin()), m_unget(0), m_string('"') +ptokenizer::ptokenizer(plib::putf8_reader &&strm) +: m_strm(std::move(strm)), m_lineno(0), m_cur_line(""), m_px(m_cur_line.begin()), m_unget(0), m_string('"') { } diff --git a/src/lib/netlist/plib/pparser.h b/src/lib/netlist/plib/pparser.h index 0dc2eb7dfbc..eb4f253c79b 100644 --- a/src/lib/netlist/plib/pparser.h +++ b/src/lib/netlist/plib/pparser.h @@ -19,7 +19,7 @@ namespace plib { class ptokenizer : nocopyassignmove { public: - explicit ptokenizer(plib::putf8_reader &strm); + ptokenizer(plib::putf8_reader &&strm); virtual ~ptokenizer(); @@ -123,7 +123,7 @@ private: bool eof() { return m_strm.eof(); } - putf8_reader &m_strm; + putf8_reader m_strm; int m_lineno; pstring m_cur_line; diff --git a/src/lib/netlist/plib/pstream.cpp b/src/lib/netlist/plib/pstream.cpp index 50a39685f70..e0094e99e38 100644 --- a/src/lib/netlist/plib/pstream.cpp +++ b/src/lib/netlist/plib/pstream.cpp @@ -41,14 +41,6 @@ postream::~postream() { } -void postream::write(pistream &strm) -{ - char buf[1024]; - pos_type r; - while ((r=strm.read(buf, 1024)) > 0) - write(buf, r); -} - // ----------------------------------------------------------------------------- // Input file stream // ----------------------------------------------------------------------------- @@ -119,7 +111,7 @@ void pifilestream::vseek(const pos_type n) throw file_e("Generic file operation failed: {}", m_filename); } -pifilestream::pos_type pifilestream::vtell() +pifilestream::pos_type pifilestream::vtell() const { long ret = ftell(static_cast(m_file)); if (ret < 0) @@ -204,7 +196,7 @@ void pofilestream::vseek(const pos_type n) } } -pstream::pos_type pofilestream::vtell() +pstream::pos_type pofilestream::vtell() const { std::ptrdiff_t ret = ftell(static_cast(m_file)); if (ret < 0) @@ -263,6 +255,11 @@ pimemstream::pimemstream(const void *mem, const pos_type len) { } +pimemstream::pimemstream() + : pistream(FLAG_SEEKABLE), m_pos(0), m_len(0), m_mem(static_cast(nullptr)) +{ +} + pimemstream::pimemstream(const pomemstream &ostrm) : pistream(FLAG_SEEKABLE), m_pos(0), m_len(ostrm.size()), m_mem(reinterpret_cast(ostrm.memory())) { @@ -295,7 +292,7 @@ void pimemstream::vseek(const pos_type n) } -pimemstream::pos_type pimemstream::vtell() +pimemstream::pos_type pimemstream::vtell() const { return m_pos; } @@ -316,7 +313,8 @@ pomemstream::pomemstream() pomemstream::~pomemstream() { - pfree_array(m_mem); + if (m_mem != nullptr) + pfree_array(m_mem); } void pomemstream::vwrite(const void *buf, const pos_type n) @@ -359,7 +357,7 @@ void pomemstream::vseek(const pos_type n) } } -pstream::pos_type pomemstream::vtell() +pstream::pos_type pomemstream::vtell() const { return m_pos; } @@ -386,11 +384,6 @@ bool putf8_reader::readline(pstring &line) return true; } -putf8_fmt_writer::putf8_fmt_writer(postream &strm) -: pfmt_writer_t() -, putf8_writer(strm) -{ -} putf8_fmt_writer::~putf8_fmt_writer() { diff --git a/src/lib/netlist/plib/pstream.h b/src/lib/netlist/plib/pstream.h index a97ecd5cbd4..e8b6c38ac66 100644 --- a/src/lib/netlist/plib/pstream.h +++ b/src/lib/netlist/plib/pstream.h @@ -11,30 +11,51 @@ #include "pstring.h" #include "pfmtlog.h" #include "pexception.h" +#include "palloc.h" + +#define USE_CSTREAM (0) #include +#include + +#if USE_CSTREAM +#include +//#include +#include +#endif + namespace plib { + +#if USE_CSTREAM +typedef std::ostream postream; +typedef std::ofstream pofilestream; +typedef std::ostringstream postringstream; +typedef std::ostringstream pomemstream; + +#endif + // ----------------------------------------------------------------------------- // pstream: things common to all streams // ----------------------------------------------------------------------------- -class pstream : nocopyassignmove +class pstream : nocopyassign { public: using pos_type = std::size_t; + using size_type = std::size_t; static constexpr pos_type SEEK_EOF = static_cast(-1); bool seekable() const { return ((m_flags & FLAG_SEEKABLE) != 0); } - void seek(const pos_type n) + void seekp(const pos_type n) { - return vseek(n); + vseek(n); } - pos_type tell() + pos_type tellp() const { return vtell(); } @@ -43,10 +64,13 @@ protected: explicit pstream(const unsigned flags) : m_flags(flags) { } + pstream(pstream &&src) : m_flags(src.m_flags) + { + } ~pstream(); virtual void vseek(const pos_type n) = 0; - virtual pos_type vtell() = 0; + virtual pos_type vtell() const = 0; static constexpr unsigned FLAG_EOF = 0x01; static constexpr unsigned FLAG_SEEKABLE = 0x04; @@ -84,8 +108,9 @@ public: protected: explicit pistream(const unsigned flags) : pstream(flags) {} + explicit pistream(pistream &&src) : pstream(std::move(src)) {} /* read up to n bytes from stream */ - virtual pos_type vread(void *buf, const pos_type n) = 0; + virtual size_type vread(void *buf, const size_type n) = 0; }; @@ -93,23 +118,23 @@ protected: // postream: output stream // ----------------------------------------------------------------------------- +#if !USE_CSTREAM class postream : public pstream { public: virtual ~postream(); - void write(const void *buf, const pos_type n) + void write(const char *buf, const size_type n) { vwrite(buf, n); } - void write(pistream &strm); - protected: explicit postream(unsigned flags) : pstream(flags) {} + explicit postream(postream &&src) : pstream(std::move(src)) {} /* write n bytes to stream */ - virtual void vwrite(const void *buf, const pos_type n) = 0; + virtual void vwrite(const void *buf, const size_type n) = 0; private: }; @@ -123,6 +148,17 @@ class pomemstream : public postream public: pomemstream(); + + pomemstream(pomemstream &&src) + : postream(std::move(src)) + , m_pos(src.m_pos) + , m_capacity(src.m_capacity) + , m_size(src.m_size) + , m_mem(src.m_mem) + { + src.m_mem = nullptr; + } + virtual ~pomemstream() override; char *memory() const { return m_mem; } @@ -132,7 +168,7 @@ protected: /* write n bytes to stream */ virtual void vwrite(const void *buf, const pos_type) override; virtual void vseek(const pos_type n) override; - virtual pos_type vtell() override; + virtual pos_type vtell() const override; private: pos_type m_pos; @@ -146,6 +182,11 @@ class postringstream : public postream public: postringstream() : postream(0) { } + postringstream(postringstream &&src) + : postream(std::move(src)) + , m_buf(src.m_buf) + { src.m_buf = ""; } + virtual ~postringstream() override; const pstring &str() { return m_buf; } @@ -157,7 +198,7 @@ protected: m_buf += pstring(static_cast(buf), n); } virtual void vseek(const pos_type n) override { } - virtual pos_type vtell() override { return m_buf.size(); } + virtual pos_type vtell() const override { return m_buf.size(); } private: pstring m_buf; @@ -171,7 +212,18 @@ class pofilestream : public postream { public: - explicit pofilestream(const pstring &fname); + pofilestream(const pstring &fname); + pofilestream(pofilestream &&src) + : postream(std::move(src)) + , m_file(src.m_file) + , m_pos(src.m_pos) + , m_actually_close(src.m_actually_close) + , m_filename(src.m_filename) + { + src.m_file = nullptr; + src.m_actually_close = false; + } + virtual ~pofilestream() override; protected: @@ -179,7 +231,7 @@ protected: /* write n bytes to stream */ virtual void vwrite(const void *buf, const pos_type n) override; virtual void vseek(const pos_type n) override; - virtual pos_type vtell() override; + virtual pos_type vtell() const override; private: void *m_file; @@ -193,6 +245,7 @@ private: // ----------------------------------------------------------------------------- // pstderr: write to stderr // ----------------------------------------------------------------------------- +#endif class pstderr : public pofilestream { @@ -220,16 +273,27 @@ class pifilestream : public pistream { public: - explicit pifilestream(const pstring &fname); + pifilestream(const pstring &fname); virtual ~pifilestream() override; + pifilestream(pifilestream &&src) + : pistream(std::move(src)) + , m_file(src.m_file) + , m_pos(src.m_pos) + , m_actually_close(src.m_actually_close) + , m_filename(src.m_filename) + { + src.m_actually_close = false; + src.m_file = nullptr; + } + protected: pifilestream(void *file, const pstring &name, const bool do_close); /* read up to n bytes from stream */ virtual pos_type vread(void *buf, const pos_type n) override; virtual void vseek(const pos_type n) override; - virtual pos_type vtell() override; + virtual pos_type vtell() const override; private: void *m_file; @@ -261,15 +325,34 @@ class pimemstream : public pistream public: pimemstream(const void *mem, const pos_type len); + pimemstream(); + + pimemstream(pimemstream &&src) + : pistream(std::move(src)) + , m_pos(src.m_pos) + , m_len(src.m_len) + , m_mem(src.m_mem) + { + src.m_mem = nullptr; + } + explicit pimemstream(const pomemstream &ostrm); + virtual ~pimemstream() override; pos_type size() const { return m_len; } protected: + + void set_mem(const void *mem, const pos_type len) + { + m_mem = static_cast(mem); + m_len = len; + } + /* read up to n bytes from stream */ virtual pos_type vread(void *buf, const pos_type n) override; virtual void vseek(const pos_type n) override; - virtual pos_type vtell() override; + virtual pos_type vtell() const override; private: pos_type m_pos; @@ -284,12 +367,22 @@ private: class pistringstream : public pimemstream { public: - explicit pistringstream(const pstring &str) : pimemstream(str.c_str(), std::strlen(str.c_str())), m_str(str) { } + pistringstream(const pstring &str) + : pimemstream() + , m_str(str) + { + set_mem(m_str.c_str(), std::strlen(m_str.c_str())); + } + pistringstream(pistringstream &&src) + : pimemstream(std::move(src)), m_str(src.m_str) + { + set_mem(m_str.c_str(), std::strlen(m_str.c_str())); + } virtual ~pistringstream() override; private: /* only needed for a reference till destruction */ - pstring m_str; + const pstring m_str; }; // ----------------------------------------------------------------------------- @@ -298,35 +391,62 @@ private: /* this digests linux & dos/windows text files */ -class putf8_reader : plib::nocopyassignmove +class putf8_reader : plib::nocopyassign { public: - explicit putf8_reader(pistream &strm) : m_strm(strm) {} - virtual ~putf8_reader() {} + putf8_reader(pistream *strm) : m_strm(strm), m_stream_owned(false) {} + virtual ~putf8_reader() + { + if (m_stream_owned && m_strm != nullptr) + pfree(m_strm); + } + + putf8_reader(putf8_reader &&src) : m_strm(src.m_strm), m_stream_owned(src.m_stream_owned) + { + src.m_strm = nullptr; + src.m_stream_owned = false; + } + + putf8_reader(pimemstream &&strm) + : m_strm(palloc(std::move(strm))), + m_stream_owned(true) + {} - bool eof() const { return m_strm.eof(); } + putf8_reader(pifilestream &&strm) + : m_strm(palloc(std::move(strm))), + m_stream_owned(true) + {} + + putf8_reader(pistringstream &&strm) + : m_strm(palloc(std::move(strm))), + m_stream_owned(true) + {} + + + bool eof() const { return m_strm->eof(); } bool readline(pstring &line); bool readbyte1(char &b) { - return (m_strm.read(&b, 1) == 1); + return (m_strm->read(&b, 1) == 1); } bool readcode(putf8string::traits_type::code_t &c) { char b[4]; - if (m_strm.read(&b[0], 1) != 1) + if (m_strm->read(&b[0], 1) != 1) return false; const std::size_t l = putf8string::traits_type::codelen(b); for (std::size_t i = 1; i < l; i++) - if (m_strm.read(&b[i], 1) != 1) + if (m_strm->read(&b[i], 1) != 1) return false; c = putf8string::traits_type::code(b); return true; } private: - pistream &m_strm; + pistream *m_strm; + bool m_stream_owned; putf8string m_linebuf; }; @@ -334,10 +454,12 @@ private: // putf8writer_t: writer on top of ostream // ----------------------------------------------------------------------------- -class putf8_writer : plib::nocopyassignmove +class putf8_writer : plib::nocopyassign { public: - explicit putf8_writer(postream &strm) : m_strm(strm) {} + explicit putf8_writer(postream *strm) : m_strm(strm) {} + + putf8_writer(putf8_writer &&src) : m_strm(src.m_strm) {} virtual ~putf8_writer() {} void writeline(const pstring &line) const @@ -349,7 +471,7 @@ public: void write(const pstring &text) const { putf8string conv_utf8(text); - m_strm.write(conv_utf8.c_str(), conv_utf8.mem_t_size()); + m_strm->write(conv_utf8.c_str(), conv_utf8.mem_t_size()); } void write(const pstring::value_type c) const @@ -359,14 +481,19 @@ public: } private: - postream &m_strm; + postream *m_strm; }; class putf8_fmt_writer : public pfmt_writer_t, public putf8_writer { public: - explicit putf8_fmt_writer(postream &strm); + explicit putf8_fmt_writer(postream *strm) + : pfmt_writer_t() + , putf8_writer(strm) + { + } + virtual ~putf8_fmt_writer() override; //protected: @@ -379,16 +506,17 @@ private: // pbinary_writer_t: writer on top of ostream // ----------------------------------------------------------------------------- -class pbinary_writer : plib::nocopyassignmove +class pbinary_writer : plib::nocopyassign { public: explicit pbinary_writer(postream &strm) : m_strm(strm) {} + pbinary_writer(pbinary_writer &&src) : m_strm(src.m_strm) {} virtual ~pbinary_writer() {} template - void write(const T val) + void write(const T &val) { - m_strm.write(&val, sizeof(T)); + m_strm.write(reinterpret_cast(&val), sizeof(T)); } void write(const pstring &s) @@ -411,10 +539,11 @@ private: postream &m_strm; }; -class pbinary_reader : plib::nocopyassignmove +class pbinary_reader : plib::nocopyassign { public: explicit pbinary_reader(pistream &strm) : m_strm(strm) {} + pbinary_reader(pbinary_reader &&src) : m_strm(src.m_strm) { } virtual ~pbinary_reader() {} template @@ -447,6 +576,15 @@ private: pistream &m_strm; }; +inline void copystream(postream &dest, pistream &src) +{ + char buf[1024]; + pstream::pos_type r; + while ((r=src.read(buf, 1024)) > 0) + dest.write(buf, r); +} + + } #endif /* PSTREAM_H_ */ diff --git a/src/lib/netlist/plib/pstring.h b/src/lib/netlist/plib/pstring.h index ebdca57c9a5..515bbe70a57 100644 --- a/src/lib/netlist/plib/pstring.h +++ b/src/lib/netlist/plib/pstring.h @@ -147,6 +147,8 @@ public: *this += static_cast(c); // FIXME: codepage conversion for u8 } + operator string_type () const { return m_str; } + pstring_t &operator=(const pstring_t &string) { m_str = string.m_str; return *this; } template read_input(const netlist::setup_t &setup, pstring fn std::vector ret; if (fname != "") { - plib::pifilestream f(fname); - plib::putf8_reader r(f); + plib::putf8_reader r = plib::putf8_reader(plib::pifilestream(fname)); pstring l; while (r.readline(l)) { @@ -402,7 +401,7 @@ void tool_app_t::static_compile() opt_logs(), opt_defines(), opt_rfolders()); - plib::putf8_writer w(pout_strm); + plib::putf8_writer w(&pout_strm); std::map mp; nt.solver()->create_solver_code(mp); @@ -724,12 +723,12 @@ int tool_app_t::execute() if (opt_file() == "-") { plib::pstdin f; - ostrm.write(f); + plib::copystream(ostrm, f); } else { plib::pifilestream f(opt_file()); - ostrm.write(f); + plib::copystream(ostrm, f); } contents = ostrm.str(); diff --git a/src/lib/netlist/prg/nlwav.cpp b/src/lib/netlist/prg/nlwav.cpp index 17d385f2c1a..1bc3505c206 100644 --- a/src/lib/netlist/prg/nlwav.cpp +++ b/src/lib/netlist/prg/nlwav.cpp @@ -51,38 +51,45 @@ private: * and data chunk length to the file. */ /* http://de.wikipedia.org/wiki/RIFF_WAVE */ + class wav_t { public: wav_t(plib::postream &strm, unsigned sr) : m_f(strm) { initialize(sr); - m_f.write(&m_fh, sizeof(m_fh)); - m_f.write(&m_fmt, sizeof(m_fmt)); - m_f.write(&m_data, sizeof(m_data)); + write(m_fh); + write(m_fmt); + write(m_data); } ~wav_t() { if (m_f.seekable()) { m_fh.filelen = m_data.len + sizeof(m_data) + sizeof(m_fh) + sizeof(m_fmt) - 8; - m_f.seek(0); - m_f.write(&m_fh, sizeof(m_fh)); - m_f.write(&m_fmt, sizeof(m_fmt)); + m_f.seekp(0); + write(m_fh); + write(m_fmt); //data.len = fmt.block_align * n; - m_f.write(&m_data, sizeof(m_data)); + write(m_data); } } unsigned channels() { return m_fmt.channels; } unsigned sample_rate() { return m_fmt.sample_rate; } + template + void write(const T &val) + { + m_f.write(reinterpret_cast(&val), sizeof(T)); + } + void write_sample(int sample) { m_data.len += m_fmt.block_align; int16_t ps = static_cast(sample); /* 16 bit sample, FIXME: Endianess? */ - m_f.write(&ps, sizeof(ps)); + write(ps); } private: @@ -150,7 +157,7 @@ public: void process() { - plib::putf8_reader reader(m_is); + plib::putf8_reader reader(&m_is); pstring line; while(reader.readline(line)) @@ -248,7 +255,7 @@ void nlwav_app::convert(long sample_rate) { plib::postream *fo = (opt_out() == "-" ? &pout_strm : plib::palloc(opt_out())); plib::pistream *fin = (opt_inp() == "-" ? &pin_strm : plib::palloc(opt_inp())); - plib::putf8_reader reader(*fin); + plib::putf8_reader reader(fin); wav_t *wo = plib::palloc(*fo, static_cast(sample_rate)); double dt = 1.0 / static_cast(wo->sample_rate()); diff --git a/src/lib/netlist/solver/nld_ms_gcr.h b/src/lib/netlist/solver/nld_ms_gcr.h index a17ca1ec282..dee76dd8281 100644 --- a/src/lib/netlist/solver/nld_ms_gcr.h +++ b/src/lib/netlist/solver/nld_ms_gcr.h @@ -298,7 +298,7 @@ template pstring matrix_solver_GCR_t::static_compile_name() { plib::postringstream t; - plib::putf8_fmt_writer w(t); + plib::putf8_fmt_writer w(&t); csc_private(w); std::hash h; @@ -309,7 +309,7 @@ template std::pair matrix_solver_GCR_t::create_solver_code() { plib::postringstream t; - plib::putf8_fmt_writer strm(t); + plib::putf8_fmt_writer strm(&t); pstring name = static_compile_name(); strm.writeline(plib::pfmt("extern \"C\" void {1}(double * __restrict m_A, double * __restrict RHS, double * __restrict V)\n")(name)); diff --git a/src/lib/netlist/tools/nl_convert.cpp b/src/lib/netlist/tools/nl_convert.cpp index b89e94ca3e5..6b6f3925a5a 100644 --- a/src/lib/netlist/tools/nl_convert.cpp +++ b/src/lib/netlist/tools/nl_convert.cpp @@ -42,8 +42,7 @@ using lib_map_t = std::unordered_map; static lib_map_t read_lib_map(const pstring &lm) { - plib::pistringstream istrm(lm); - plib::putf8_reader reader(istrm); + auto reader = plib::putf8_reader(plib::pistringstream(lm)); lib_map_t m; pstring line; while (reader.readline(line)) @@ -59,7 +58,7 @@ static lib_map_t read_lib_map(const pstring &lm) -------------------------------------------------*/ nl_convert_base_t::nl_convert_base_t() - : out(m_buf) + : out(&m_buf) , m_numberchars("0123456789-+e.") { } @@ -401,8 +400,8 @@ void nl_convert_spice_t::process_line(const pstring &line) Eagle converter -------------------------------------------------*/ -nl_convert_eagle_t::tokenizer::tokenizer(nl_convert_eagle_t &convert, plib::putf8_reader &strm) - : plib::ptokenizer(strm) +nl_convert_eagle_t::tokenizer::tokenizer(nl_convert_eagle_t &convert, plib::putf8_reader &&strm) + : plib::ptokenizer(std::move(strm)) , m_convert(convert) { set_identifier_chars("abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-"); @@ -429,9 +428,8 @@ void nl_convert_eagle_t::tokenizer::verror(const pstring &msg, int line_num, con //FIXME: should accept a stream as well void nl_convert_eagle_t::convert(const pstring &contents) { - plib::pistringstream istrm(contents); - plib::putf8_reader reader(istrm); - tokenizer tok(*this, reader); + + tokenizer tok(*this, plib::putf8_reader(plib::pistringstream(contents))); out("NETLIST_START(dummy)\n"); add_term("GND", "GND"); @@ -539,8 +537,8 @@ void nl_convert_eagle_t::convert(const pstring &contents) RINF converter -------------------------------------------------*/ -nl_convert_rinf_t::tokenizer::tokenizer(nl_convert_rinf_t &convert, plib::putf8_reader &strm) - : plib::ptokenizer(strm) +nl_convert_rinf_t::tokenizer::tokenizer(nl_convert_rinf_t &convert, plib::putf8_reader &&strm) + : plib::ptokenizer(std::move(strm)) , m_convert(convert) { set_identifier_chars(".abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_-"); @@ -579,9 +577,7 @@ void nl_convert_rinf_t::tokenizer::verror(const pstring &msg, int line_num, cons void nl_convert_rinf_t::convert(const pstring &contents) { - plib::pistringstream istrm(contents); - plib::putf8_reader reader(istrm); - tokenizer tok(*this, reader); + tokenizer tok(*this, plib::putf8_reader(plib::pistringstream(contents))); auto lm = read_lib_map(s_lib_map); out("NETLIST_START(dummy)\n"); diff --git a/src/lib/netlist/tools/nl_convert.h b/src/lib/netlist/tools/nl_convert.h index d3881320678..1433f75664c 100644 --- a/src/lib/netlist/tools/nl_convert.h +++ b/src/lib/netlist/tools/nl_convert.h @@ -166,7 +166,7 @@ public: class tokenizer : public plib::ptokenizer { public: - tokenizer(nl_convert_eagle_t &convert, plib::putf8_reader &strm); + tokenizer(nl_convert_eagle_t &convert, plib::putf8_reader &&strm); token_id_t m_tok_ADD; token_id_t m_tok_VALUE; @@ -202,7 +202,7 @@ public: class tokenizer : public plib::ptokenizer { public: - tokenizer(nl_convert_rinf_t &convert, plib::putf8_reader &strm); + tokenizer(nl_convert_rinf_t &convert, plib::putf8_reader &&strm); token_id_t m_tok_HEA; token_id_t m_tok_APP; -- cgit v1.2.3-70-g09d2 From b57ceef133b88f1b89944bde71e75a378ae68848 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 13 Jan 2019 13:59:54 +0100 Subject: netlist: Added && and || operators to preprocessor expressions. (nw) --- src/lib/netlist/plib/pparser.cpp | 73 ++++++++++++++++------------------------ src/lib/netlist/plib/pparser.h | 2 +- 2 files changed, 30 insertions(+), 45 deletions(-) (limited to 'src/lib/netlist/plib/pparser.cpp') diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp index 2d1a426f5a5..f70001530c4 100644 --- a/src/lib/netlist/plib/pparser.cpp +++ b/src/lib/netlist/plib/pparser.cpp @@ -283,6 +283,8 @@ ppreprocessor::ppreprocessor(std::vector *defines) m_expr_sep.push_back("-"); m_expr_sep.push_back("*"); m_expr_sep.push_back("/"); + m_expr_sep.push_back("&&"); + m_expr_sep.push_back("||"); m_expr_sep.push_back("=="); m_expr_sep.push_back(" "); m_expr_sep.push_back("\t"); @@ -302,36 +304,30 @@ void ppreprocessor::error(const pstring &err) throw pexception("PREPRO ERROR: " + err); } +#define CHECKTOK2(p_op, p_prio) \ + else if (tok == # p_op) \ + { \ + if (prio < p_prio) \ + return val; \ + start++; \ + const auto v2 = expr(sexpr, start, p_prio); \ + val = (val p_op v2); \ + } \ +// Operator precedence see https://en.cppreference.com/w/cpp/language/operator_precedence -double ppreprocessor::expr(const std::vector &sexpr, std::size_t &start, int prio) +int ppreprocessor::expr(const std::vector &sexpr, std::size_t &start, int prio) { - double val; + int val; pstring tok=sexpr[start]; if (tok == "(") { start++; - val = expr(sexpr, start, /*prio*/ 0); + val = expr(sexpr, start, /*prio*/ 255); if (sexpr[start] != ")") error("parsing error!"); start++; } - else if (tok == "!") - { - start++; - val = expr(sexpr, start, 90); - if (val != 0) - val = 0; - else - val = 1; - } - else - { - tok=sexpr[start]; - // FIXME: error handling - val = plib::pstonum(tok); - start++; - } while (start < sexpr.size()) { tok=sexpr[start]; @@ -340,36 +336,25 @@ double ppreprocessor::expr(const std::vector &sexpr, std::size_t &start // FIXME: catch error return val; } - else if (tok == "+") + else if (tok == "!") { - if (prio > 10) + if (prio < 3) return val; start++; - val = val + expr(sexpr, start, 10); + val = !expr(sexpr, start, 3); } - else if (tok == "-") - { - if (prio > 10) - return val; - start++; - val = val - expr(sexpr, start, 10); - } - else if (tok == "*") - { - start++; - val = val * expr(sexpr, start, 20); - } - else if (tok == "/") - { - start++; - val = val / expr(sexpr, start, 20); - } - else if (tok == "==") + CHECKTOK2(*, 5) + CHECKTOK2(/, 5) + CHECKTOK2(+, 6) + CHECKTOK2(-, 6) + CHECKTOK2(==, 10) + CHECKTOK2(&&, 14) + CHECKTOK2(||, 15) + else { - if (prio > 5) - return val; + // FIXME: error handling + val = plib::pstonum(tok); start++; - val = (val == expr(sexpr, start, 5)) ? 1.0 : 0.0; } } return val; @@ -418,7 +403,7 @@ pstring ppreprocessor::process_line(const pstring &line) std::size_t start = 0; lt = replace_macros(lt); std::vector t(psplit(replace_all(lt.substr(3), pstring(" "), pstring("")), m_expr_sep)); - int val = static_cast(expr(t, start, 0)); + int val = static_cast(expr(t, start, 255)); if (val == 0) m_ifflag |= (1 << m_level); } diff --git a/src/lib/netlist/plib/pparser.h b/src/lib/netlist/plib/pparser.h index eb4f253c79b..17f43284e2c 100644 --- a/src/lib/netlist/plib/pparser.h +++ b/src/lib/netlist/plib/pparser.h @@ -164,7 +164,7 @@ public: void process(putf8_reader &istrm, putf8_writer &ostrm); protected: - double expr(const std::vector &sexpr, std::size_t &start, int prio); + int expr(const std::vector &sexpr, std::size_t &start, int prio); define_t *get_define(const pstring &name); pstring replace_macros(const pstring &line); virtual void error(const pstring &err); -- cgit v1.2.3-70-g09d2 From 0a17d35c13f770e8b69fb0a68f1485631dfc3578 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 13 Jan 2019 19:57:39 +0100 Subject: netlist: Fix logging during object construction. (nw) --- src/devices/machine/netlist.cpp | 37 +++++++++++++++++--------- src/devices/machine/netlist.h | 1 + src/lib/netlist/analog/nlid_twoterm.h | 20 +++++++++----- src/lib/netlist/netlist_types.h | 28 ++++++++++++++++++++ src/lib/netlist/nl_base.cpp | 13 ++++----- src/lib/netlist/nl_base.h | 50 ++++++++++++----------------------- src/lib/netlist/nl_setup.cpp | 4 +-- src/lib/netlist/nl_setup.h | 4 +-- src/lib/netlist/plib/pomp.h | 2 ++ src/lib/netlist/plib/pparser.cpp | 2 +- src/lib/netlist/prg/nltool.cpp | 24 ++++++++++++----- src/lib/netlist/solver/nld_solver.cpp | 2 +- 12 files changed, 114 insertions(+), 73 deletions(-) (limited to 'src/lib/netlist/plib/pparser.cpp') diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp index 137c9e6cf6c..ffd99d5437a 100644 --- a/src/devices/machine/netlist.cpp +++ b/src/devices/machine/netlist.cpp @@ -49,21 +49,16 @@ DEFINE_DEVICE_TYPE(NETLIST_STREAM_OUTPUT, netlist_mame_stream_output_device, "nl // Special netlist extension devices .... // ---------------------------------------------------------------------------------------- -class netlist_mame_device::netlist_mame_t : public netlist::netlist_t +class netlist_mame_device::netlist_mame_callbacks_t : public netlist::callbacks_t { public: - netlist_mame_t(netlist_mame_device &parent, const pstring &aname) - : netlist::netlist_t(aname) + netlist_mame_callbacks_t(netlist_mame_device &parent) + : netlist::callbacks_t() , m_parent(parent) { } - running_machine &machine() { return m_parent.machine(); } - - - netlist_mame_device &parent() { return m_parent; } - protected: void vlog(const plib::plog_level &l, const pstring &ls) const override { @@ -95,6 +90,24 @@ private: }; +class netlist_mame_device::netlist_mame_t : public netlist::netlist_t +{ +public: + + netlist_mame_t(netlist_mame_device &parent, const pstring &aname) + : netlist::netlist_t(aname, plib::make_unique(parent)) + , m_parent(parent) + { + } + + running_machine &machine() { return m_parent.machine(); } + netlist_mame_device &parent() { return m_parent; } + +private: + netlist_mame_device &m_parent; +}; + + namespace { // ---------------------------------------------------------------------------------------- @@ -173,7 +186,7 @@ public: NETLIB_UPDATEI() { - netlist_sig_t cur = m_in(); + netlist::netlist_sig_t cur = m_in(); // FIXME: make this a parameter // avoid calls due to noise @@ -190,7 +203,7 @@ private: netlist::logic_input_t m_in; netlist_mame_logic_output_device::output_delegate m_callback; netlist_mame_cpu_device *m_cpu_device; - netlist::state_var m_last; + netlist::state_var m_last; }; // ---------------------------------------------------------------------------------------- @@ -505,7 +518,7 @@ void netlist_mame_cpu_device::state_string_export(const device_state_entry &entr if (entry.index() & 1) str = string_format("%10.6f", *((double *)entry.dataptr())); else - str = string_format("%d", *((netlist_sig_t *)entry.dataptr())); + str = string_format("%d", *((netlist::netlist_sig_t *)entry.dataptr())); } } @@ -837,8 +850,6 @@ void netlist_mame_device::device_start() m_netlist = global_alloc(netlist_mame_t(*this, "netlist")); - m_netlist->load_base_libraries(); - // register additional devices nl_register_devices(); diff --git a/src/devices/machine/netlist.h b/src/devices/machine/netlist.h index b400acdf32a..dbd862a12e2 100644 --- a/src/devices/machine/netlist.h +++ b/src/devices/machine/netlist.h @@ -99,6 +99,7 @@ class netlist_mame_device : public device_t { public: class netlist_mame_t; + class netlist_mame_callbacks_t; // construction/destruction netlist_mame_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); diff --git a/src/lib/netlist/analog/nlid_twoterm.h b/src/lib/netlist/analog/nlid_twoterm.h index 624dd98e558..4ab5fcda89b 100644 --- a/src/lib/netlist/analog/nlid_twoterm.h +++ b/src/lib/netlist/analog/nlid_twoterm.h @@ -48,6 +48,20 @@ namespace netlist // nld_twoterm // ----------------------------------------------------------------------------- + template + inline core_device_t &bselect(bool b, C &d1, core_device_t &d2) + { + core_device_t *h = dynamic_cast(&d1); + return b ? *h : d2; + } + template<> + inline core_device_t &bselect(bool b, netlist_t &d1, core_device_t &d2) + { + if (b) + throw nl_exception("bselect with netlist and b==true"); + return d2; + } + NETLIB_OBJECT(twoterm) { NETLIB_CONSTRUCTOR_EX(twoterm, bool terminals_owned = false) @@ -87,12 +101,6 @@ public: } private: - template - static core_device_t &bselect(bool b, C &d1, core_device_t &d2) - { - core_device_t *h = dynamic_cast(&d1); - return b ? *h : d2; - } }; diff --git a/src/lib/netlist/netlist_types.h b/src/lib/netlist/netlist_types.h index d5fe7b11e20..bbca9949e49 100644 --- a/src/lib/netlist/netlist_types.h +++ b/src/lib/netlist/netlist_types.h @@ -12,12 +12,40 @@ #include "nl_config.h" #include "plib/pchrono.h" #include "plib/pstring.h" +#include "plib/pfmtlog.h" #include #include namespace netlist { + /*! @brief netlist_sig_t is the type used for logic signals. + * + * This may be any of bool, uint8_t, uint16_t, uin32_t and uint64_t. + * The choice has little to no impact on performance. + */ + using netlist_sig_t = std::uint32_t; + + /** + * @brief Interface definition for netlist callbacks into calling code + * + * A class inheriting from netlist_callbacks_t has to be passed to the netlist_t + * constructor. Netlist does processing during construction and thus needs + * the object passed completely constructed. + * + */ + class callbacks_t + { + public: + virtual ~callbacks_t() {} + + /* logging callback */ + virtual void vlog(const plib::plog_level &l, const pstring &ls) const = 0; + }; + + using log_type = plib::plog_base; + + //============================================================ // Performance tracking //============================================================ diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index 6a8ac148151..4bdec442f17 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -239,20 +239,22 @@ detail::terminal_type detail::core_terminal_t::type() const // netlist_t // ---------------------------------------------------------------------------------------- -netlist_t::netlist_t(const pstring &aname) +netlist_t::netlist_t(const pstring &aname, std::unique_ptr callbacks) : m_time(netlist_time::zero()) , m_queue(*this) , m_mainclock(nullptr) , m_solver(nullptr) , m_params(nullptr) , m_name(aname) - , m_log(*this) , m_lib(nullptr) , m_state() + , m_callbacks(std::move(callbacks)) // Order is important here + , m_log(*m_callbacks) { state().save_item(this, static_cast(m_queue), "m_queue"); state().save_item(this, m_time, "m_time"); m_setup = plib::make_unique(*this); + NETLIST_NAME(base)(*m_setup); } netlist_t::~netlist_t() @@ -261,11 +263,6 @@ netlist_t::~netlist_t() m_devices.clear(); } -void netlist_t::load_base_libraries() -{ - NETLIST_NAME(base)(*m_setup); -} - nl_double netlist_t::gmin() const NL_NOEXCEPT { return solver()->gmin(); @@ -694,7 +691,7 @@ void core_device_t::set_default_delegate(detail::core_terminal_t &term) term.m_delegate.set(&core_device_t::update, this); } -plib::plog_base &core_device_t::log() +log_type & core_device_t::log() { return netlist().log(); } diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index 24129821b4b..6e4f9c50543 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -9,6 +9,11 @@ #ifndef NLBASE_H_ #define NLBASE_H_ +#ifdef NL_PROHIBIT_BASEH_INCLUDE +#error "nl_base.h included. Please correct." +#endif + +#include "netlist_types.h" #include "nl_lists.h" #include "nl_time.h" #include "plib/palloc.h" // owned_ptr @@ -20,21 +25,6 @@ #include -#ifdef NL_PROHIBIT_BASEH_INCLUDE -#error "nl_base.h included. Please correct." -#endif - -// ---------------------------------------------------------------------------------------- -// Type definitions -// ---------------------------------------------------------------------------------------- - -/*! @brief netlist_sig_t is the type used for logic signals. - * - * This may be any of bool, uint8_t, uint16_t, uin32_t and uint64_t. - * The choice has little to no impact on performance. - */ -using netlist_sig_t = std::uint32_t; - //============================================================ // MACROS / New Syntax //============================================================ @@ -221,6 +211,7 @@ namespace netlist class netlist_t; class core_device_t; class device_t; + class callbacks_t; //============================================================ // Exceptions @@ -1115,7 +1106,7 @@ namespace netlist update(); } - plib::plog_base &log(); + log_type & log(); public: virtual void timestep(const nl_double st) { plib::unused_var(st); } @@ -1178,6 +1169,7 @@ namespace netlist // ----------------------------------------------------------------------------- // nld_base_dummy : basis for dummy devices + // FIXME: this is not the right place to define this // ----------------------------------------------------------------------------- NETLIB_OBJECT(base_dummy) @@ -1223,16 +1215,8 @@ namespace netlist { public: - explicit netlist_t(const pstring &aname); - virtual ~netlist_t(); - - /** - * @brief Load base libraries for diodes, transistors ... - * - * This must be called after netlist_t is created. - * - */ - void load_base_libraries(); + explicit netlist_t(const pstring &aname, std::unique_ptr callbacks); + ~netlist_t(); /* run functions */ @@ -1292,8 +1276,9 @@ namespace netlist /* logging and name */ pstring name() const { return m_name; } - plib::plog_base &log() { return m_log; } - const plib::plog_base &log() const { return m_log; } + + log_type & log() { return m_log; } + const log_type &log() const { return m_log; } /* state related */ @@ -1319,9 +1304,6 @@ namespace netlist // FIXME: sort rebuild_lists out void rebuild_lists(); /* must be called after post_load ! */ - /* logging callback */ - virtual void vlog(const plib::plog_level &l, const pstring &ls) const = 0; - protected: void print_stats() const; @@ -1345,8 +1327,6 @@ namespace netlist devices::NETLIB_NAME(netlistparams) *m_params; pstring m_name; - std::unique_ptr m_setup; - plib::plog_base m_log; std::unique_ptr m_lib; // external lib needs to be loaded as long as netlist exists plib::state_manager_t m_state; @@ -1356,6 +1336,10 @@ namespace netlist nperfcount_t m_perf_out_processed; std::vector> m_devices; + + std::unique_ptr m_callbacks; + log_type m_log; + std::unique_ptr m_setup; }; // ----------------------------------------------------------------------------- diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp index a02d5f5bbae..e876b2f7e8b 100644 --- a/src/lib/netlist/nl_setup.cpp +++ b/src/lib/netlist/nl_setup.cpp @@ -768,11 +768,11 @@ void setup_t::start_devices() } } -plib::plog_base &setup_t::log() +log_type &setup_t::log() { return netlist().log(); } -const plib::plog_base &setup_t::log() const +const log_type &setup_t::log() const { return netlist().log(); } diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h index cae829023a4..3894cad5415 100644 --- a/src/lib/netlist/nl_setup.h +++ b/src/lib/netlist/nl_setup.h @@ -288,8 +288,8 @@ namespace netlist /* helper - also used by nltool */ const pstring resolve_alias(const pstring &name) const; - plib::plog_base &log(); - const plib::plog_base &log() const; + log_type &log(); + const log_type &log() const; //std::vector> m_device_factory; std::unordered_map m_device_factory; diff --git a/src/lib/netlist/plib/pomp.h b/src/lib/netlist/plib/pomp.h index 221c0d61c00..f13df2539ac 100644 --- a/src/lib/netlist/plib/pomp.h +++ b/src/lib/netlist/plib/pomp.h @@ -9,6 +9,8 @@ #ifndef POMP_H_ #define POMP_H_ +#include + #include "pconfig.h" #if HAS_OPENMP diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp index f70001530c4..43ed9e14d41 100644 --- a/src/lib/netlist/plib/pparser.cpp +++ b/src/lib/netlist/plib/pparser.cpp @@ -318,7 +318,7 @@ void ppreprocessor::error(const pstring &err) int ppreprocessor::expr(const std::vector &sexpr, std::size_t &start, int prio) { - int val; + int val = 0; pstring tok=sexpr[start]; if (tok == "(") { diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index c7c3ac652fd..0a5fba22d9e 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -132,22 +132,35 @@ std::unique_ptr netlist_data_folder_t::stream(const pstring &fil return std::unique_ptr(nullptr); } +class netlist_tool_callbacks_t : public netlist::callbacks_t +{ +public: + netlist_tool_callbacks_t(tool_app_t &app) + : netlist::callbacks_t() + , m_app(app) + { } + + void vlog(const plib::plog_level &l, const pstring &ls) const override; + +private: + tool_app_t &m_app; +}; + class netlist_tool_t : public netlist::netlist_t { public: netlist_tool_t(tool_app_t &app, const pstring &aname) - : netlist::netlist_t(aname), m_app(app) + : netlist::netlist_t(aname, plib::make_unique(app)) { } - virtual ~netlist_tool_t() override + ~netlist_tool_t() { } void init() { - load_base_libraries(); } void read_netlist(const pstring &filename, const pstring &name, @@ -234,13 +247,10 @@ public: protected: - void vlog(const plib::plog_level &l, const pstring &ls) const override; - private: - tool_app_t &m_app; }; -void netlist_tool_t::vlog(const plib::plog_level &l, const pstring &ls) const +void netlist_tool_callbacks_t::vlog(const plib::plog_level &l, const pstring &ls) const { pstring err = plib::pfmt("{}: {}\n")(l.name())(ls.c_str()); // FIXME: ... diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp index 760b7088e67..f9de00d417d 100644 --- a/src/lib/netlist/solver/nld_solver.cpp +++ b/src/lib/netlist/solver/nld_solver.cpp @@ -104,7 +104,7 @@ NETLIB_UPDATE(solver) if (nthreads > 1 && solvers.size() > 1) { plib::omp::set_num_threads(nthreads); - plib::omp::for_static(static_cast(0), solvers.size(), [this, &solvers](std::size_t i) + plib::omp::for_static(static_cast(0), solvers.size(), [&solvers](std::size_t i) { const netlist_time ts = solvers[i]->solve(); plib::unused_var(ts); -- cgit v1.2.3-70-g09d2 From 17d32e0bd5b98761fea3e1f42f73bdb8d197ea69 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sat, 19 Jan 2019 18:17:35 +0100 Subject: netlist: pstream and ppreprocessor (now a pistream) refactoring. (nw) --- src/lib/netlist/nl_parser.cpp | 11 ++- src/lib/netlist/nl_parser.h | 8 ++- src/lib/netlist/nl_setup.cpp | 21 ++---- src/lib/netlist/nl_setup.h | 2 +- src/lib/netlist/plib/pparser.cpp | 33 ++++----- src/lib/netlist/plib/pparser.h | 53 ++++++++++++--- src/lib/netlist/plib/pstream.cpp | 20 ++---- src/lib/netlist/plib/pstream.h | 128 ++++++++++++++++++++--------------- src/lib/netlist/prg/nlwav.cpp | 27 ++++---- src/lib/netlist/tools/nl_convert.cpp | 26 ++++--- 10 files changed, 182 insertions(+), 147 deletions(-) (limited to 'src/lib/netlist/plib/pparser.cpp') diff --git a/src/lib/netlist/nl_parser.cpp b/src/lib/netlist/nl_parser.cpp index a2ab7623b3b..460ff3819bf 100644 --- a/src/lib/netlist/nl_parser.cpp +++ b/src/lib/netlist/nl_parser.cpp @@ -24,14 +24,13 @@ void parser_t::verror(const pstring &msg, int line_num, const pstring &line) //throw error; } - bool parser_t::parse(const pstring &nlname) { - set_identifier_chars("abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-"); - set_number_chars(".0123456789", "0123456789eE-."); //FIXME: processing of numbers - //set_whitespace(pstring("").cat(' ').cat(9).cat(10).cat(13)); - set_whitespace(pstring("") + ' ' + static_cast(9) + static_cast(10) + static_cast(13)); - set_comment("/*", "*/", "//"); + this->identifier_chars("abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-") + .number_chars(".0123456789", "0123456789eE-.") //FIXME: processing of numbers + //set_whitespace(pstring("").cat(' ').cat(9).cat(10).cat(13)); + .whitespace(pstring("") + ' ' + static_cast(9) + static_cast(10) + static_cast(13)) + .comment("/*", "*/", "//"); m_tok_param_left = register_token("("); m_tok_param_right = register_token(")"); m_tok_comma = register_token(","); diff --git a/src/lib/netlist/nl_parser.h b/src/lib/netlist/nl_parser.h index a36ca39e29e..f14250ea7d1 100644 --- a/src/lib/netlist/nl_parser.h +++ b/src/lib/netlist/nl_parser.h @@ -16,8 +16,12 @@ namespace netlist class parser_t : public plib::ptokenizer { public: - parser_t(plib::putf8_reader &&strm, setup_t &setup) - : plib::ptokenizer(std::move(strm)), m_setup(setup) {} + template + parser_t(T &&strm, setup_t &setup) + : plib::ptokenizer(std::move(strm)) + , m_setup(setup) + { + } bool parse(const pstring &nlname = ""); diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp index 5e7a0e8933c..67a8afe94b9 100644 --- a/src/lib/netlist/nl_setup.cpp +++ b/src/lib/netlist/nl_setup.cpp @@ -907,6 +907,11 @@ void setup_t::tt_factory_create(tt_desc &desc, const pstring &sourcefile) // Sources // ---------------------------------------------------------------------------------------- +bool setup_t::parse_stream(std::unique_ptr istrm, const pstring &name) +{ + return parser_t(std::move(plib::ppreprocessor(&m_defines).process(std::move(istrm))), *this).parse(name); +} + void setup_t::include(const pstring &netlist_name) { for (auto &source : m_sources) @@ -932,18 +937,6 @@ std::unique_ptr setup_t::get_data_stream(const pstring &name) return std::unique_ptr(nullptr); } - -bool setup_t::parse_stream(plib::putf8_reader &&istrm, const pstring &name) -{ - plib::pomemstream ostrm; - plib::putf8_writer owrt(&ostrm); - - plib::ppreprocessor(&m_defines).process(istrm, owrt); - plib::putf8_reader reader2 = plib::putf8_reader(plib::pimemstream(ostrm)); - - return parser_t(std::move(reader2), *this).parse(name); -} - void setup_t::register_define(const pstring &defstr) { auto p = defstr.find("="); @@ -1080,9 +1073,7 @@ bool source_t::parse(const pstring &name) return false; else { - auto rstream = stream(name); - plib::putf8_reader reader(rstream.get()); - return m_setup.parse_stream(std::move(reader), name); + return m_setup.parse_stream(stream(name), name); } } diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h index 193905ed62b..53efe523bcc 100644 --- a/src/lib/netlist/nl_setup.h +++ b/src/lib/netlist/nl_setup.h @@ -265,7 +265,7 @@ namespace netlist std::unique_ptr get_data_stream(const pstring &name); - bool parse_stream(plib::putf8_reader &&istrm, const pstring &name); + bool parse_stream(std::unique_ptr istrm, const pstring &name); /* register a source */ diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp index 43ed9e14d41..f7b7c7bae36 100644 --- a/src/lib/netlist/plib/pparser.cpp +++ b/src/lib/netlist/plib/pparser.cpp @@ -16,11 +16,6 @@ namespace plib { // A simple tokenizer // ---------------------------------------------------------------------------------------- -ptokenizer::ptokenizer(plib::putf8_reader &&strm) -: m_strm(std::move(strm)), m_lineno(0), m_cur_line(""), m_px(m_cur_line.begin()), m_unget(0), m_string('"') -{ -} - ptokenizer::~ptokenizer() { } @@ -274,7 +269,11 @@ void ptokenizer::error(const pstring &errs) // ---------------------------------------------------------------------------------------- ppreprocessor::ppreprocessor(std::vector *defines) -: m_ifflag(0), m_level(0), m_lineno(0) +: pistream() +, m_ifflag(0) +, m_level(0) +, m_lineno(0) +, m_pos(0) { m_expr_sep.push_back("!"); m_expr_sep.push_back("("); @@ -304,6 +303,18 @@ void ppreprocessor::error(const pstring &err) throw pexception("PREPRO ERROR: " + err); } +pstream::size_type ppreprocessor::vread(value_type *buf, const pstream::size_type n) +{ + size_type bytes = std::min(m_buf.size() - m_pos, n); + + if (bytes==0) + return 0; + + std::memcpy(buf, m_buf.c_str() + m_pos, bytes); + m_pos += bytes; + return bytes; +} + #define CHECKTOK2(p_op, p_prio) \ else if (tok == # p_op) \ { \ @@ -462,15 +473,5 @@ pstring ppreprocessor::process_line(const pstring &line) } -void ppreprocessor::process(putf8_reader &istrm, putf8_writer &ostrm) -{ - pstring line; - while (istrm.readline(line)) - { - m_lineno++; - line = process_line(line); - ostrm.writeline(line); - } -} } diff --git a/src/lib/netlist/plib/pparser.h b/src/lib/netlist/plib/pparser.h index 17f43284e2c..36ecd02e017 100644 --- a/src/lib/netlist/plib/pparser.h +++ b/src/lib/netlist/plib/pparser.h @@ -19,7 +19,11 @@ namespace plib { class ptokenizer : nocopyassignmove { public: - ptokenizer(plib::putf8_reader &&strm); + template + ptokenizer(T &&strm) + : m_strm(std::move(strm)), m_lineno(0), m_cur_line(""), m_px(m_cur_line.begin()), m_unget(0), m_string('"') + { + } virtual ~ptokenizer(); @@ -98,15 +102,16 @@ public: return ret; } - void set_identifier_chars(pstring s) { m_identifier_chars = s; } - void set_number_chars(pstring st, pstring rem) { m_number_chars_start = st; m_number_chars = rem; } - void set_string_char(pstring::value_type c) { m_string = c; } - void set_whitespace(pstring s) { m_whitespace = s; } - void set_comment(pstring start, pstring end, pstring line) + ptokenizer & identifier_chars(pstring s) { m_identifier_chars = s; return *this; } + ptokenizer & number_chars(pstring st, pstring rem) { m_number_chars_start = st; m_number_chars = rem; return *this; } + ptokenizer & string_char(pstring::value_type c) { m_string = c; return *this; } + ptokenizer & whitespace(pstring s) { m_whitespace = s; return *this; } + ptokenizer & comment(pstring start, pstring end, pstring line) { m_tok_comment_start = register_token(start); m_tok_comment_end = register_token(end); m_tok_line_comment = register_token(line); + return *this; } token_t get_token_internal(); @@ -145,7 +150,7 @@ private: }; -class ppreprocessor : plib::nocopyassignmove +class ppreprocessor : public pistream { public: @@ -159,11 +164,39 @@ public: }; explicit ppreprocessor(std::vector *defines = nullptr); - virtual ~ppreprocessor() {} + virtual ~ppreprocessor() override {} - void process(putf8_reader &istrm, putf8_writer &ostrm); + template + ppreprocessor & process(T &&istrm) + { + putf8_reader reader(std::move(istrm)); + pstring line; + while (reader.readline(line)) + { + m_lineno++; + line = process_line(line); + m_buf += decltype(m_buf)(line.c_str()) + static_cast(10); + } + return *this; + } + + ppreprocessor(ppreprocessor &&s) + : m_defines(s.m_defines) + , m_expr_sep(s.m_expr_sep) + , m_ifflag(s.m_ifflag) + , m_level(s.m_level) + , m_lineno(s.m_lineno) + , m_buf(s.m_buf) + , m_pos(s.m_pos) + { + } protected: + + virtual size_type vread(value_type *buf, const size_type n) override; + virtual void vseek(const pos_type n) override { } + virtual pos_type vtell() const override { return m_pos; } + int expr(const std::vector &sexpr, std::size_t &start, int prio); define_t *get_define(const pstring &name); pstring replace_macros(const pstring &line); @@ -179,6 +212,8 @@ private: std::uint_least64_t m_ifflag; // 31 if levels int m_level; int m_lineno; + pstring_t m_buf; + pos_type m_pos; }; } diff --git a/src/lib/netlist/plib/pstream.cpp b/src/lib/netlist/plib/pstream.cpp index e0094e99e38..9c99438811c 100644 --- a/src/lib/netlist/plib/pstream.cpp +++ b/src/lib/netlist/plib/pstream.cpp @@ -29,18 +29,10 @@ pstream::~pstream() // pistream: input stream // ----------------------------------------------------------------------------- -pistream::~pistream() -{ -} - // ----------------------------------------------------------------------------- // postream: output stream // ----------------------------------------------------------------------------- -postream::~postream() -{ -} - // ----------------------------------------------------------------------------- // Input file stream // ----------------------------------------------------------------------------- @@ -83,7 +75,7 @@ pifilestream::~pifilestream() } } -pifilestream::pos_type pifilestream::vread(void *buf, const pos_type n) +pifilestream::pos_type pifilestream::vread(value_type *buf, const pos_type n) { pos_type r = fread(buf, 1, n, static_cast(m_file)); if (r < n) @@ -172,7 +164,7 @@ pofilestream::~pofilestream() } } -void pofilestream::vwrite(const void *buf, const pos_type n) +void pofilestream::vwrite(const value_type *buf, const pos_type n) { std::size_t r = fwrite(buf, 1, n, static_cast(m_file)); if (r < n) @@ -269,13 +261,13 @@ pimemstream::~pimemstream() { } -pimemstream::pos_type pimemstream::vread(void *buf, const pos_type n) +pimemstream::pos_type pimemstream::vread(value_type *buf, const pos_type n) { pos_type ret = (m_pos + n <= m_len) ? n : m_len - m_pos; if (ret > 0) { - std::copy(m_mem + m_pos, m_mem + m_pos + ret, static_cast(buf)); + std::copy(m_mem + m_pos, m_mem + m_pos + ret, reinterpret_cast(buf)); m_pos += ret; } @@ -317,7 +309,7 @@ pomemstream::~pomemstream() pfree_array(m_mem); } -void pomemstream::vwrite(const void *buf, const pos_type n) +void pomemstream::vwrite(const value_type *buf, const pos_type n) { if (m_pos + n >= m_capacity) { @@ -333,7 +325,7 @@ void pomemstream::vwrite(const void *buf, const pos_type n) pfree_array(o); } - std::copy(static_cast(buf), static_cast(buf) + n, m_mem + m_pos); + std::copy(buf, buf + n, m_mem + m_pos); m_pos += n; m_size = std::max(m_pos, m_size); } diff --git a/src/lib/netlist/plib/pstream.h b/src/lib/netlist/plib/pstream.h index e8b6c38ac66..cc86a1a39ea 100644 --- a/src/lib/netlist/plib/pstream.h +++ b/src/lib/netlist/plib/pstream.h @@ -61,6 +61,9 @@ public: } protected: + pstream() : m_flags(0) + { + } explicit pstream(const unsigned flags) : m_flags(flags) { } @@ -93,52 +96,62 @@ private: // pistream: input stream // ----------------------------------------------------------------------------- -class pistream : public pstream +template +class pistream_base : public pstream { public: - virtual ~pistream(); + typedef T value_type; + + virtual ~pistream_base() { } bool eof() const { return ((flags() & FLAG_EOF) != 0); } - pos_type read(void *buf, const pos_type n) + pos_type read(T *buf, const pos_type n) { return vread(buf, n); } protected: - explicit pistream(const unsigned flags) : pstream(flags) {} - explicit pistream(pistream &&src) : pstream(std::move(src)) {} + pistream_base() : pstream(0) {} + explicit pistream_base(const unsigned flags) : pstream(flags) {} + explicit pistream_base(pistream_base &&src) : pstream(std::move(src)) {} /* read up to n bytes from stream */ - virtual size_type vread(void *buf, const size_type n) = 0; - + virtual size_type vread(T *buf, const size_type n) = 0; }; +typedef pistream_base pistream; + // ----------------------------------------------------------------------------- // postream: output stream // ----------------------------------------------------------------------------- #if !USE_CSTREAM -class postream : public pstream +template +class postream_base : public pstream { public: - virtual ~postream(); + typedef T value_type; + + virtual ~postream_base() { } - void write(const char *buf, const size_type n) + void write(const T *buf, const size_type n) { vwrite(buf, n); } protected: - explicit postream(unsigned flags) : pstream(flags) {} - explicit postream(postream &&src) : pstream(std::move(src)) {} + explicit postream_base(unsigned flags) : pstream(flags) {} + explicit postream_base(postream_base &&src) : pstream(std::move(src)) {} /* write n bytes to stream */ - virtual void vwrite(const void *buf, const size_type n) = 0; + virtual void vwrite(const T *buf, const size_type n) = 0; private: }; +typedef postream_base postream; + // ----------------------------------------------------------------------------- // pomemstream: output string stream // ----------------------------------------------------------------------------- @@ -166,7 +179,7 @@ public: protected: /* write n bytes to stream */ - virtual void vwrite(const void *buf, const pos_type) override; + virtual void vwrite(const value_type *buf, const pos_type) override; virtual void vseek(const pos_type n) override; virtual pos_type vtell() const override; @@ -193,9 +206,9 @@ public: protected: /* write n bytes to stream */ - virtual void vwrite(const void *buf, const pos_type n) override + virtual void vwrite(const value_type *buf, const pos_type n) override { - m_buf += pstring(static_cast(buf), n); + m_buf += pstring(reinterpret_cast(buf), n); } virtual void vseek(const pos_type n) override { } virtual pos_type vtell() const override { return m_buf.size(); } @@ -229,7 +242,7 @@ public: protected: pofilestream(void *file, const pstring &name, const bool do_close); /* write n bytes to stream */ - virtual void vwrite(const void *buf, const pos_type n) override; + virtual void vwrite(const value_type *buf, const pos_type n) override; virtual void vseek(const pos_type n) override; virtual pos_type vtell() const override; @@ -291,7 +304,7 @@ protected: pifilestream(void *file, const pstring &name, const bool do_close); /* read up to n bytes from stream */ - virtual pos_type vread(void *buf, const pos_type n) override; + virtual pos_type vread(value_type *buf, const pos_type n) override; virtual void vseek(const pos_type n) override; virtual pos_type vtell() const override; @@ -350,7 +363,7 @@ protected: } /* read up to n bytes from stream */ - virtual pos_type vread(void *buf, const pos_type n) override; + virtual pos_type vread(value_type *buf, const pos_type n) override; virtual void vseek(const pos_type n) override; virtual pos_type vtell() const override; @@ -391,65 +404,68 @@ private: /* this digests linux & dos/windows text files */ + +template +struct constructor_helper +{ + std::unique_ptr operator()(T &&s) { return std::move(plib::make_unique(std::move(s))); } +}; + class putf8_reader : plib::nocopyassign { public: - putf8_reader(pistream *strm) : m_strm(strm), m_stream_owned(false) {} - virtual ~putf8_reader() - { - if (m_stream_owned && m_strm != nullptr) - pfree(m_strm); - } - putf8_reader(putf8_reader &&src) : m_strm(src.m_strm), m_stream_owned(src.m_stream_owned) + virtual ~putf8_reader() { - src.m_strm = nullptr; - src.m_stream_owned = false; } - putf8_reader(pimemstream &&strm) - : m_strm(palloc(std::move(strm))), - m_stream_owned(true) - {} - - putf8_reader(pifilestream &&strm) - : m_strm(palloc(std::move(strm))), - m_stream_owned(true) - {} + template + friend struct constructor_helper; - putf8_reader(pistringstream &&strm) - : m_strm(palloc(std::move(strm))), - m_stream_owned(true) + template + putf8_reader(T &&strm) + : m_strm(std::move(constructor_helper()(std::move(strm)))) {} - bool eof() const { return m_strm->eof(); } bool readline(pstring &line); - bool readbyte1(char &b) + bool readbyte1(pistream::value_type &b) { return (m_strm->read(&b, 1) == 1); } bool readcode(putf8string::traits_type::code_t &c) { - char b[4]; + pistream::value_type b[4]; if (m_strm->read(&b[0], 1) != 1) return false; - const std::size_t l = putf8string::traits_type::codelen(b); + const std::size_t l = putf8string::traits_type::codelen(reinterpret_cast(&b)); for (std::size_t i = 1; i < l; i++) if (m_strm->read(&b[i], 1) != 1) return false; - c = putf8string::traits_type::code(b); + c = putf8string::traits_type::code(reinterpret_cast(&b)); return true; } private: - pistream *m_strm; - bool m_stream_owned; + std::unique_ptr m_strm; putf8string m_linebuf; }; +template <> +struct constructor_helper +{ + std::unique_ptr operator()(putf8_reader &&s) { return std::move(s.m_strm); } +}; + +template <> +struct constructor_helper> +{ + std::unique_ptr operator()(std::unique_ptr &&s) { return std::move(s); } +}; + + // ----------------------------------------------------------------------------- // putf8writer_t: writer on top of ostream // ----------------------------------------------------------------------------- @@ -471,7 +487,7 @@ public: void write(const pstring &text) const { putf8string conv_utf8(text); - m_strm->write(conv_utf8.c_str(), conv_utf8.mem_t_size()); + m_strm->write(reinterpret_cast(conv_utf8.c_str()), conv_utf8.mem_t_size()); } void write(const pstring::value_type c) const @@ -516,13 +532,13 @@ public: template void write(const T &val) { - m_strm.write(reinterpret_cast(&val), sizeof(T)); + m_strm.write(reinterpret_cast(&val), sizeof(T)); } void write(const pstring &s) { - const char *sm = s.c_str(); - const std::size_t sl = std::strlen(sm); + const postream::value_type *sm = reinterpret_cast(s.c_str()); + const std::size_t sl = std::strlen(s.c_str()); write(sl); m_strm.write(sm, sl); } @@ -532,7 +548,7 @@ public: { std::size_t sz = val.size(); write(sz); - m_strm.write(val.data(), sizeof(T) * sz); + m_strm.write(reinterpret_cast(val.data()), sizeof(T) * sz); } private: @@ -549,7 +565,7 @@ public: template void read(T &val) { - m_strm.read(&val, sizeof(T)); + m_strm.read(reinterpret_cast(&val), sizeof(T)); } void read( pstring &s) @@ -557,7 +573,7 @@ public: std::size_t sz = 0; read(sz); plib::string_info::mem_t *buf = new plib::string_info::mem_t[sz+1]; - m_strm.read(buf, sz); + m_strm.read(reinterpret_cast(buf), sz); buf[sz] = 0; s = pstring(buf); delete [] buf; @@ -569,7 +585,7 @@ public: std::size_t sz = 0; read(sz); val.resize(sz); - m_strm.read(val.data(), sizeof(T) * sz); + m_strm.read(reinterpret_cast(val.data()), sizeof(T) * sz); } private: @@ -578,7 +594,7 @@ private: inline void copystream(postream &dest, pistream &src) { - char buf[1024]; + postream::value_type buf[1024]; pstream::pos_type r; while ((r=src.read(buf, 1024)) > 0) dest.write(buf, r); diff --git a/src/lib/netlist/prg/nlwav.cpp b/src/lib/netlist/prg/nlwav.cpp index 1bc3505c206..361b1db5195 100644 --- a/src/lib/netlist/prg/nlwav.cpp +++ b/src/lib/netlist/prg/nlwav.cpp @@ -82,7 +82,7 @@ public: template void write(const T &val) { - m_f.write(reinterpret_cast(&val), sizeof(T)); + m_f.write(reinterpret_cast(&val), sizeof(T)); } void write_sample(int sample) @@ -153,11 +153,11 @@ class log_processor { public: typedef plib::pmfp callback_type; - log_processor(plib::pistream &is, callback_type cb) : m_is(is), m_cb(cb) { } + log_processor(callback_type cb) : m_cb(cb) { } - void process() + void process(std::unique_ptr &&is) { - plib::putf8_reader reader(&m_is); + plib::putf8_reader reader(std::move(is)); pstring line; while(reader.readline(line)) @@ -169,7 +169,6 @@ public: } private: - plib::pistream &m_is; callback_type m_cb; }; @@ -254,8 +253,10 @@ private: void nlwav_app::convert(long sample_rate) { plib::postream *fo = (opt_out() == "-" ? &pout_strm : plib::palloc(opt_out())); - plib::pistream *fin = (opt_inp() == "-" ? &pin_strm : plib::palloc(opt_inp())); - plib::putf8_reader reader(fin); + std::unique_ptr fin = (opt_inp() == "-" ? + plib::make_unique() + : plib::make_unique(opt_inp())); + plib::putf8_reader reader(std::move(fin)); wav_t *wo = plib::palloc(*fo, static_cast(sample_rate)); double dt = 1.0 / static_cast(wo->sample_rate()); @@ -324,8 +325,6 @@ void nlwav_app::convert(long sample_rate) #endif } plib::pfree(wo); - if (opt_inp() != "-") - plib::pfree(fin); if (opt_out() != "-") plib::pfree(fo); @@ -341,15 +340,17 @@ void nlwav_app::convert(long sample_rate) void nlwav_app::convert1(long sample_rate) { plib::postream *fo = (opt_out() == "-" ? &pout_strm : plib::palloc(opt_out())); - plib::pistream *fin = (opt_inp() == "-" ? &pin_strm : plib::palloc(opt_inp())); + std::unique_ptr fin = (opt_inp() == "-" ? + plib::make_unique() + : plib::make_unique(opt_inp())); double dt = 1.0 / static_cast(sample_rate); wavwriter *wo = plib::palloc(*fo, static_cast(sample_rate), opt_amp()); aggregator ag(dt, aggregator::callback_type(&wavwriter::process, wo)); - log_processor lp(*fin, log_processor::callback_type(&aggregator::process, &ag)); + log_processor lp(log_processor::callback_type(&aggregator::process, &ag)); - lp.process(); + lp.process(std::move(fin)); if (!opt_quiet()) { @@ -360,8 +361,6 @@ void nlwav_app::convert1(long sample_rate) } plib::pfree(wo); - if (opt_inp() != "-") - plib::pfree(fin); if (opt_out() != "-") plib::pfree(fo); diff --git a/src/lib/netlist/tools/nl_convert.cpp b/src/lib/netlist/tools/nl_convert.cpp index 52665ce1f78..998ebf53c7e 100644 --- a/src/lib/netlist/tools/nl_convert.cpp +++ b/src/lib/netlist/tools/nl_convert.cpp @@ -405,13 +405,12 @@ nl_convert_eagle_t::tokenizer::tokenizer(nl_convert_eagle_t &convert, plib::putf : plib::ptokenizer(std::move(strm)) , m_convert(convert) { - set_identifier_chars("abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-"); - set_number_chars(".0123456789", "0123456789eE-."); //FIXME: processing of numbers - //set_whitespace(pstring("").cat(' ').cat(9).cat(10).cat(13)); - set_whitespace(pstring("") + ' ' + static_cast(9) + static_cast(10) + static_cast(13)); - /* FIXME: gnetlist doesn't print comments */ - set_comment("/*", "*/", "//"); - set_string_char('\''); + this->identifier_chars("abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-") + .number_chars(".0123456789", "0123456789eE-.") //FIXME: processing of numbers + .whitespace(pstring("") + ' ' + static_cast(9) + static_cast(10) + static_cast(13)) + /* FIXME: gnetlist doesn't print comments */ + .comment("/*", "*/", "//") + .string_char('\''); m_tok_ADD = register_token("ADD"); m_tok_VALUE = register_token("VALUE"); m_tok_SIGNAL = register_token("SIGNAL"); @@ -542,13 +541,12 @@ nl_convert_rinf_t::tokenizer::tokenizer(nl_convert_rinf_t &convert, plib::putf8_ : plib::ptokenizer(std::move(strm)) , m_convert(convert) { - set_identifier_chars(".abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_-"); - set_number_chars("0123456789", "0123456789eE-."); //FIXME: processing of numbers - //set_whitespace(pstring("").cat(' ').cat(9).cat(10).cat(13)); - set_whitespace(pstring("") + ' ' + static_cast(9) + static_cast(10) + static_cast(13)); - /* FIXME: gnetlist doesn't print comments */ - set_comment("","","//"); // FIXME:needs to be confirmed - set_string_char('"'); + this->identifier_chars(".abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_-") + .number_chars("0123456789", "0123456789eE-.") //FIXME: processing of numbers + .whitespace(pstring("") + ' ' + static_cast(9) + static_cast(10) + static_cast(13)) + /* FIXME: gnetlist doesn't print comments */ + .comment("","","//") // FIXME:needs to be confirmed + .string_char('"'); m_tok_HEA = register_token(".HEA"); m_tok_APP = register_token(".APP"); m_tok_TIM = register_token(".TIM"); -- cgit v1.2.3-70-g09d2 From 26420facff351d16d15a9ace7434aeaabccce9b5 Mon Sep 17 00:00:00 2001 From: couriersud Date: Sun, 20 Jan 2019 22:17:58 +0100 Subject: netlist: add comment processing to preprocessor. [couriersud] Comments are now processed in the preprocessor. Previously directives in multiline comments were processed. --- src/lib/netlist/plib/pparser.cpp | 65 ++++++++++++++++++++++++++++++++++- src/lib/netlist/plib/pparser.h | 13 ++++++- src/lib/netlist/solver/nld_solver.cpp | 2 +- src/mame/audio/nl_kidniki.cpp | 2 +- 4 files changed, 78 insertions(+), 4 deletions(-) (limited to 'src/lib/netlist/plib/pparser.cpp') diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp index f7b7c7bae36..8cfc2b20cec 100644 --- a/src/lib/netlist/plib/pparser.cpp +++ b/src/lib/netlist/plib/pparser.cpp @@ -274,6 +274,8 @@ ppreprocessor::ppreprocessor(std::vector *defines) , m_level(0) , m_lineno(0) , m_pos(0) +, m_state(PROCESS) +, m_comment(false) { m_expr_sep.push_back("!"); m_expr_sep.push_back("("); @@ -400,8 +402,69 @@ static pstring catremainder(const std::vector &elems, std::size_t start return ret; } -pstring ppreprocessor::process_line(const pstring &line) +pstring ppreprocessor::process_comments(pstring line) { + bool in_string = false; + + std::size_t e = line.size(); + pstring ret = ""; + for (std::size_t i=0; i < e; ) + { + pstring c = plib::left(line, 1); + line = line.substr(1); + if (!m_comment) + { + if (c=="\"") + { + in_string = !in_string; + ret += c; + } + else if (in_string && c=="\\") + { + i++; + ret += (c + plib::left(line, 1)); + line = line.substr(1); + } + else if (!in_string && c=="/" && plib::left(line,1) == "*") + m_comment = true; + else if (!in_string && c=="/" && plib::left(line,1) == "/") + break; + else + ret += c; + } + else + if (c=="*" && plib::left(line,1) == "/") + { + i++; + line = line.substr(1); + m_comment = false; + } + i++; + } + return ret; +} + +pstring ppreprocessor::process_line(pstring line) +{ + bool line_cont = plib::right(line, 1) == "\\"; + if (line_cont) + line = plib::left(line, line.size() - 1); + + if (m_state == LINE_CONTINUATION) + m_line += line; + else + m_line = line; + + if (line_cont) + { + m_state = LINE_CONTINUATION; + return ""; + } + else + m_state = PROCESS; + + line = process_comments(m_line); + pstring lt = plib::trim(plib::replace_all(line, pstring("\t"), pstring(" "))); pstring ret; // FIXME ... revise and extend macro handling diff --git a/src/lib/netlist/plib/pparser.h b/src/lib/netlist/plib/pparser.h index 36ecd02e017..1eeb92d797b 100644 --- a/src/lib/netlist/plib/pparser.h +++ b/src/lib/netlist/plib/pparser.h @@ -188,6 +188,8 @@ public: , m_lineno(s.m_lineno) , m_buf(s.m_buf) , m_pos(s.m_pos) + , m_state(s.m_state) + , m_comment(s.m_comment) { } @@ -204,7 +206,13 @@ protected: private: - pstring process_line(const pstring &line); + enum state_e + { + PROCESS, + LINE_CONTINUATION + }; + pstring process_line(pstring line); + pstring process_comments(pstring line); std::unordered_map m_defines; std::vector m_expr_sep; @@ -214,6 +222,9 @@ private: int m_lineno; pstring_t m_buf; pos_type m_pos; + state_e m_state; + pstring m_line; + bool m_comment; }; } diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp index c578dedefbf..3421081b7ec 100644 --- a/src/lib/netlist/solver/nld_solver.cpp +++ b/src/lib/netlist/solver/nld_solver.cpp @@ -288,7 +288,7 @@ void NETLIB_NAME(solver)::post_start() switch (net_count) { -#if 1 +#if 0 case 1: if (use_specific) ms = plib::palloc(state(), sname, &m_params); diff --git a/src/mame/audio/nl_kidniki.cpp b/src/mame/audio/nl_kidniki.cpp index a8bad7ace16..f430637868f 100644 --- a/src/mame/audio/nl_kidniki.cpp +++ b/src/mame/audio/nl_kidniki.cpp @@ -2,7 +2,7 @@ // copyright-holders:Andrew Gardner, Couriersud #include "netlist/devices/net_lib.h" -#define USE_FRONTIERS 0 +#define USE_FRONTIERS 1 #define USE_FIXED_STV 1 /* ---------------------------------------------------------------------------- -- cgit v1.2.3-70-g09d2 From 76323eb770cca3655f40d400fe5f34fbaa573d6c Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 27 Jan 2019 14:22:20 +1100 Subject: srcclean and cleanup (nw) --- hash/apple2_flop_orig.xml | 6224 ++++++++++++++-------------- hash/clickstart_cart.xml | 14 +- hash/ekara_japan.xml | 60 +- hash/ekara_japan_d.xml | 6 +- hash/ekara_japan_en.xml | 12 +- hash/ekara_japan_g.xml | 36 +- hash/ekara_japan_m.xml | 4 +- hash/ekara_japan_p.xml | 8 +- hash/ekara_japan_s.xml | 6 +- hash/ekara_japan_sp.xml | 10 +- hash/ekara_us.xml | 2 +- hash/jakks_gamekey_dy.xml | 34 +- hash/jakks_gamekey_nk.xml | 10 +- hash/jakks_gamekey_sw.xml | 8 +- hash/pce_tourvision.xml | 18 +- hash/vsmile_cart.xml | 2 +- hash/vtech_storio_cart.xml | 10 +- scripts/src/machine.lua | 2 +- src/devices/bus/bbc/rom/dfs.cpp | 2 +- src/devices/bus/ekara/rom.cpp | 2 +- src/devices/bus/electron/romboxp.cpp | 4 +- src/devices/bus/nubus/nubus_specpdq.cpp | 39 +- src/devices/bus/vsmile/vsmile_slot.h | 4 +- src/devices/cpu/alpha/alpha.cpp | 4 +- src/devices/cpu/dspp/dspp.h | 18 +- src/devices/cpu/dspp/dsppdrc.cpp | 334 +- src/devices/cpu/m6502/xavix2000.cpp | 12 +- src/devices/cpu/mips/mips3.cpp | 8 +- src/devices/cpu/mips/mips3.h | 2 +- src/devices/cpu/mips/mips3drc.cpp | 10 +- src/devices/cpu/unsp/unsp.h | 12 +- src/devices/cpu/unsp/unspdefs.h | 10 +- src/devices/cpu/unsp/unspdrc.cpp | 12 +- src/devices/machine/nsc810.h | 2 +- src/devices/machine/smc91c9x.cpp | 64 +- src/devices/machine/smc91c9x.h | 6 +- src/devices/machine/spg110.cpp | 8 +- src/devices/machine/spg2xx.cpp | 30 +- src/devices/machine/wd33c9x.cpp | 8 +- src/devices/video/fixfreq.cpp | 2 +- src/emu/devfind.cpp | 2 +- src/frontend/mame/ui/icorender.cpp | 4 +- src/frontend/mame/ui/selgame.cpp | 9 +- src/lib/netlist/devices/net_lib.cpp | 2 +- src/lib/netlist/devices/nld_74107.cpp | 6 +- src/lib/netlist/devices/nld_7450.cpp | 4 +- src/lib/netlist/devices/nld_7490.cpp | 4 +- src/lib/netlist/devices/nld_7493.cpp | 2 +- src/lib/netlist/devices/nld_7497.cpp | 2 +- src/lib/netlist/devices/nld_7497.h | 4 +- src/lib/netlist/nl_base.cpp | 2 +- src/lib/netlist/nl_base.h | 10 +- src/lib/netlist/nl_errstr.h | 2 +- src/lib/netlist/nl_lists.h | 6 +- src/lib/netlist/nl_setup.h | 2 +- src/lib/netlist/plib/parray.h | 36 +- src/lib/netlist/plib/pparser.cpp | 16 +- src/lib/netlist/plib/pstring.h | 2 +- src/lib/netlist/prg/nltool.cpp | 2 +- src/lib/netlist/prg/nlwav.cpp | 12 +- src/lib/netlist/solver/nld_matrix_solver.h | 2 +- src/lib/netlist/solver/nld_ms_gmres.h | 10 +- src/mame/drivers/5clown.cpp | 12 +- src/mame/drivers/aerofgt.cpp | 2 +- src/mame/drivers/alg.cpp | 2 +- src/mame/drivers/argus.cpp | 4 +- src/mame/drivers/avt.cpp | 12 +- src/mame/drivers/battlane.cpp | 4 +- src/mame/drivers/bigevglf.cpp | 2 +- src/mame/drivers/blktiger.cpp | 4 +- src/mame/drivers/brkthru.cpp | 8 +- src/mame/drivers/chinagat.cpp | 18 +- src/mame/drivers/clickstart.cpp | 20 +- src/mame/drivers/dacholer.cpp | 2 +- src/mame/drivers/ddragon.cpp | 16 +- src/mame/drivers/deniam.cpp | 6 +- src/mame/drivers/discoboy.cpp | 2 +- src/mame/drivers/drmicro.cpp | 2 +- src/mame/drivers/dynax.cpp | 34 +- src/mame/drivers/fantland.cpp | 8 +- src/mame/drivers/fcrash.cpp | 32 +- src/mame/drivers/firetrap.cpp | 18 +- src/mame/drivers/fromance.cpp | 18 +- src/mame/drivers/fuukifg2.cpp | 4 +- src/mame/drivers/gaiden.cpp | 2 +- src/mame/drivers/galspnbl.cpp | 6 +- src/mame/drivers/gladiatr.cpp | 18 +- src/mame/drivers/goal92.cpp | 2 +- src/mame/drivers/gsword.cpp | 10 +- src/mame/drivers/hnayayoi.cpp | 2 +- src/mame/drivers/hp_ipc.cpp | 2 +- src/mame/drivers/hyperspt.cpp | 14 +- src/mame/drivers/indy_indigo2.cpp | 22 +- src/mame/drivers/karnov.cpp | 4 +- src/mame/drivers/kchamp.cpp | 12 +- src/mame/drivers/klax.cpp | 6 +- src/mame/drivers/konamim2.cpp | 2 +- src/mame/drivers/kungfur.cpp | 8 +- src/mame/drivers/kurukuru.cpp | 2 +- src/mame/drivers/lkage.cpp | 2 +- src/mame/drivers/lucky74.cpp | 16 +- src/mame/drivers/lwings.cpp | 20 +- src/mame/drivers/m90.cpp | 2 +- src/mame/drivers/matmania.cpp | 4 +- src/mame/drivers/megadriv_acbl.cpp | 2 +- src/mame/drivers/mermaid.cpp | 2 +- src/mame/drivers/metlclsh.cpp | 4 +- src/mame/drivers/mgavegas.cpp | 2 +- src/mame/drivers/miniboy7.cpp | 14 +- src/mame/drivers/mitchell.cpp | 10 +- src/mame/drivers/mjkjidai.cpp | 2 +- src/mame/drivers/namcond1.cpp | 2 +- src/mame/drivers/nmg5.cpp | 4 +- src/mame/drivers/ojankohs.cpp | 24 +- src/mame/drivers/opwolf.cpp | 16 +- src/mame/drivers/pachifev.cpp | 4 +- src/mame/drivers/palestra.cpp | 2 +- src/mame/drivers/pc9801.cpp | 2 +- src/mame/drivers/pcktgal.cpp | 2 +- src/mame/drivers/peplus.cpp | 8 +- src/mame/drivers/r9751.cpp | 4 +- src/mame/drivers/rad_eu3a14.cpp | 18 +- src/mame/drivers/rainbow.cpp | 6 +- src/mame/drivers/rastan.cpp | 8 +- src/mame/drivers/rmhaihai.cpp | 2 +- src/mame/drivers/sanremo.cpp | 24 +- src/mame/drivers/seta.cpp | 4 +- src/mame/drivers/sf.cpp | 8 +- src/mame/drivers/smc777.cpp | 18 +- src/mame/drivers/sms_bootleg.cpp | 2 +- src/mame/drivers/sothello.cpp | 4 +- src/mame/drivers/spg110.cpp | 10 +- src/mame/drivers/splash.cpp | 10 +- src/mame/drivers/srmp2.cpp | 22 +- src/mame/drivers/storio.cpp | 18 +- src/mame/drivers/suprgolf.cpp | 4 +- src/mame/drivers/system16.cpp | 2 +- src/mame/drivers/taito_l.cpp | 20 +- src/mame/drivers/taitoair.cpp | 4 +- src/mame/drivers/tbowl.cpp | 4 +- src/mame/drivers/tehkanwc.cpp | 8 +- src/mame/drivers/testpat.cpp | 8 +- src/mame/drivers/toaplan1.cpp | 8 +- src/mame/drivers/topspeed.cpp | 4 +- src/mame/drivers/trackfld.cpp | 12 +- src/mame/drivers/trkfldch.cpp | 4 +- src/mame/drivers/tubep.cpp | 18 +- src/mame/drivers/twincobr.cpp | 4 +- src/mame/drivers/vigilant.cpp | 2 +- src/mame/drivers/vii.cpp | 40 +- src/mame/drivers/wacky_gator.cpp | 10 +- src/mame/drivers/wardner.cpp | 6 +- src/mame/drivers/warriorb.cpp | 8 +- src/mame/drivers/wc90b.cpp | 4 +- src/mame/drivers/welltris.cpp | 4 +- src/mame/drivers/wgp.cpp | 6 +- src/mame/drivers/xavix.cpp | 76 +- src/mame/drivers/yunsung8.cpp | 8 +- src/mame/includes/vsmile.h | 18 +- src/mame/includes/xavix.h | 6 +- src/mame/machine/hpc1.cpp | 24 +- src/mame/machine/hpc1.h | 4 +- src/mame/machine/hpc3.cpp | 30 +- src/mame/machine/hpc3.h | 4 +- src/mame/machine/mbc55x_kbd.cpp | 6 +- src/mame/machine/nl_palestra.cpp | 14 +- src/mame/machine/nl_tp1983.cpp | 8 +- src/mame/machine/nl_tp1985.cpp | 18 +- src/mame/machine/pce_cd.cpp | 4 +- src/mame/machine/taitocchip.cpp | 8 +- src/mame/machine/xavix.cpp | 4 +- src/mame/machine/xavix2002_io.cpp | 2 +- src/mame/machine/xavix2002_io.h | 2 +- src/mame/machine/xbox_pci.cpp | 2 +- src/mame/video/arabian.cpp | 8 +- src/mame/video/funworld.cpp | 6 +- src/mame/video/tia.cpp | 192 +- src/mame/video/xavix.cpp | 2 +- 178 files changed, 4239 insertions(+), 4231 deletions(-) (limited to 'src/lib/netlist/plib/pparser.cpp') diff --git a/hash/apple2_flop_orig.xml b/hash/apple2_flop_orig.xml index 92c0f8da1ac..ce26055f178 100644 --- a/hash/apple2_flop_orig.xml +++ b/hash/apple2_flop_orig.xml @@ -3,3123 +3,3123 @@ - - Agent USA - 1984 - Scholastic - - - - - - - - - - - - - Airheart - 1986 - Broderbund Software - - - - - - - - - - - - - Alien Ambush - 1981 - Micro Distributors - - - - - - - - - - - - - Ankh - 1983 - Datamost - - - - - - - - - - - - - Apple Cider Spider - 1983 - Sierra On-Line - - - - - - - - - - - - - Apple Galaxian - 1980 - Broderbund Software - - - - - - - - - - - - - Aquatron - 1983 - Sierra On-Line - - - - - - - - - - - - - Archon: The Light and The Dark - 1984 - Electronic Arts - - - - - - - - - - - - - Ardy the Aardvark - 1983 - Datamost - - - - - - - - - - - - - Autobahn - 1981 - Sirius Software - - - - - - - - - - - - - Axis Assassin - 1982 - Electronic Arts - - - - - - - - - - - - - Aztec - 1982 - Datamost - - - - - - - - - - - - - Bad Dudes - 1988 - Data East USA - - - - - - - - - - - - - - - - - - - - Ballblazer - 1985 - Epyx - - - - - - - - - - - - - Batman: The Caped Crusader - 1985 - Data East USA - - - - - - - - - - - - - - - - - - - - BC's Quest for Tires - 1983 - Sierra On-Line - - - - - - - - - - - - - Bellhop - 1982 - Hayden Book Company - - - - - - - - - - - - - Below the Root - 1984 - Hayden Book Company - - - - - - - - - - - - - - - - - - - - The Bilestoad - 1983 - Datamost - - - - - - - - - - - - - Bug Battle - 1982 - United Software of America - - - - - - - - - - - - - Cannonball Blitz - 1982 - On-Line Systems - - - - - - - - - - - - - Caverns of Callisto - 1983 - Origin Systems - - - - - - - - - - - - - Ceiling Zero - 1981 - Turnkey Software - - - - - - - - - - - - - Centipede - 1983 - Atarisoft - - - - - - - - - - - - - Commando - 1987 - Data East USA - - - - - - - - - - - - - Congo Bongo - 1987 - SEGA Enterprises - - - - - - - - - - - - - Conquering Worlds - 1983 - Datamost - - - - - - - - - - - - - Copts and Robbers - 1981 - Sirius Software - - - - - - - - - - - - - County Fair - 1981 - Datamost - - - - - - - - - - - - - Crazy Mazey - 1982 - Datamost - - - - - - - - - - - - - Crisis Mountain - 1982 - Micro Fun - - - - - - - - - - - - - Crossfire - 1981 - On-Line Systems - - - - - - - - - - - - - Cubit - 1983 - Micromax - - - - - - - - - - - - - Cyber Strike - 1980 - Sirius Software - - - - - - - - - - - - - The Dam Busters - 1985 - Accolade - - - - - - - - - - - - - Death Sword - 1987 - Epyx - - - - - - - - - - - - - Defender II: Stargate - 1983 - Atarisoft - - - - - - - - - - - - - Destroyer - 1986 - Epyx - - - - - - - - - - - - - Dino Eggs - 1983 - Micro Fun - - - - - - - - - - - - - Dive Bomber - 1988 - Epyx - - - - - - - - - - - - - Donkey Kong - 1983 - Atarisoft - - - - - - - - - - - - - Drol - 1983 - Broderbund Software - - - - - - - - - - - - - Dung Beetles - 1982 - Datasoft - - - - - - - - - - - - - The Eidolon - 1985 - Epyx - - - - - - - - - - - - - Epoch - 1981 - Sirius Software - - - - - - - - - - - - - Falcons - 1981 - Piccadilly Software - - - - - - - - - - - - - - Fight Night - 1985 - Accolade - - - - - - - - - - - - - Flight Simulator II (v2.0) - 1985 - Accolade - - - - - - - - - - - - - Flip Out - 1982 - Sirius Software - - - - - - - - - - - - - Force 7 - 1987 - Datasoft - - - - - - - - - - - - - Formula 1 Racer - 1983 - Gentry Software - - - - - - - - - - - - - Free Fall - 1982 - Sirius Software - - - - - - - - - - - - - Frogger - 1981 - Sierra On-Line - - - - - - - - - - - - - Frogger II: Threedeep - 1984 - SEGA Enterprises - - - - - - - - - - - - - G.I. Joe - 1985 - Epyx - - - - - - - - - - - - - - - - - - - - The Games - Summer Edition - 1988 - Epyx - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GATO - 1985 - Spectrum Holobyte - - - - - - - - - - - - - Genetic Drift - 1981 - Broderbund Software - - - - - - - - - - - - - Gobbler - 1981 - On-Line Systems - - - - - - - - - - - - - The Goonies - 1985 - Datasoft - - - - - - - - - - - - - Gumball - 1983 - Broderbund Software - - - - - - - - - - - - - The Heist - 1983 - Micro Fun - - - - - - - - - - - - - HERO - Helicopter Emergency Rescue Operation - 1983 - Activision - - - - - - - - - - - - - Hadron - 1981 - Sirius Software - - - - - - - - - - - - - Hard Hat Mack - 1983 - Electronic Arts - - - - - - - - - - - - Hardball - 1985 - Accolade - - - - - - - - - - - - - Head On - 1980 - California Pacific Computers - - - - - - - - - - - - - High Rise - 1983 - Micro Fun - - - - - - - - - - - - - Ikari Warriors - 1983 - Data East USA - - - - - - - - - - - - - - - - - - - - Ikari Warriors 2: Victory Road - 1981 - Sirius Software - - - - - - - - - - - - - - - - - + + Agent USA + 1984 + Scholastic + + + + + + + + + + + + + Airheart + 1986 + Broderbund Software + + + + + + + + + + + + + Alien Ambush + 1981 + Micro Distributors + + + + + + + + + + + + + Ankh + 1983 + Datamost + + + + + + + + + + + + + Apple Cider Spider + 1983 + Sierra On-Line + + + + + + + + + + + + + Apple Galaxian + 1980 + Broderbund Software + + + + + + + + + + + + + Aquatron + 1983 + Sierra On-Line + + + + + + + + + + + + + Archon: The Light and The Dark + 1984 + Electronic Arts + + + + + + + + + + + + + Ardy the Aardvark + 1983 + Datamost + + + + + + + + + + + + + Autobahn + 1981 + Sirius Software + + + + + + + + + + + + + Axis Assassin + 1982 + Electronic Arts + + + + + + + + + + + + + Aztec + 1982 + Datamost + + + + + + + + + + + + + Bad Dudes + 1988 + Data East USA + + + + + + + + + + + + + + + + + + + + Ballblazer + 1985 + Epyx + + + + + + + + + + + + + Batman: The Caped Crusader + 1985 + Data East USA + + + + + + + + + + + + + + + + + + + + BC's Quest for Tires + 1983 + Sierra On-Line + + + + + + + + + + + + + Bellhop + 1982 + Hayden Book Company + + + + + + + + + + + + + Below the Root + 1984 + Hayden Book Company + + + + + + + + + + + + + + + + + + + + The Bilestoad + 1983 + Datamost + + + + + + + + + + + + + Bug Battle + 1982 + United Software of America + + + + + + + + + + + + + Cannonball Blitz + 1982 + On-Line Systems + + + + + + + + + + + + + Caverns of Callisto + 1983 + Origin Systems + + + + + + + + + + + + + Ceiling Zero + 1981 + Turnkey Software + + + + + + + + + + + + + Centipede + 1983 + Atarisoft + + + + + + + + + + + + + Commando + 1987 + Data East USA + + + + + + + + + + + + + Congo Bongo + 1987 + SEGA Enterprises + + + + + + + + + + + + + Conquering Worlds + 1983 + Datamost + + + + + + + + + + + + + Copts and Robbers + 1981 + Sirius Software + + + + + + + + + + + + + County Fair + 1981 + Datamost + + + + + + + + + + + + + Crazy Mazey + 1982 + Datamost + + + + + + + + + + + + + Crisis Mountain + 1982 + Micro Fun + + + + + + + + + + + + + Crossfire + 1981 + On-Line Systems + + + + + + + + + + + + + Cubit + 1983 + Micromax + + + + + + + + + + + + + Cyber Strike + 1980 + Sirius Software + + + + + + + + + + + + + The Dam Busters + 1985 + Accolade + + + + + + + + + + + + + Death Sword + 1987 + Epyx + + + + + + + + + + + + + Defender II: Stargate + 1983 + Atarisoft + + + + + + + + + + + + + Destroyer + 1986 + Epyx + + + + + + + + + + + + + Dino Eggs + 1983 + Micro Fun + + + + + + + + + + + + + Dive Bomber + 1988 + Epyx + + + + + + + + + + + + + Donkey Kong + 1983 + Atarisoft + + + + + + + + + + + + + Drol + 1983 + Broderbund Software + + + + + + + + + + + + + Dung Beetles + 1982 + Datasoft + + + + + + + + + + + + + The Eidolon + 1985 + Epyx + + + + + + + + + + + + + Epoch + 1981 + Sirius Software + + + + + + + + + + + + + Falcons + 1981 + Piccadilly Software + + + + + + + + + + + + + + Fight Night + 1985 + Accolade + + + + + + + + + + + + + Flight Simulator II (v2.0) + 1985 + Accolade + + + + + + + + + + + + + Flip Out + 1982 + Sirius Software + + + + + + + + + + + + + Force 7 + 1987 + Datasoft + + + + + + + + + + + + + Formula 1 Racer + 1983 + Gentry Software + + + + + + + + + + + + + Free Fall + 1982 + Sirius Software + + + + + + + + + + + + + Frogger + 1981 + Sierra On-Line + + + + + + + + + + + + + Frogger II: Threedeep + 1984 + SEGA Enterprises + + + + + + + + + + + + + G.I. Joe + 1985 + Epyx + + + + + + + + + + + + + + + + + + + + The Games - Summer Edition + 1988 + Epyx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GATO + 1985 + Spectrum Holobyte + + + + + + + + + + + + + Genetic Drift + 1981 + Broderbund Software + + + + + + + + + + + + + Gobbler + 1981 + On-Line Systems + + + + + + + + + + + + + The Goonies + 1985 + Datasoft + + + + + + + + + + + + + Gumball + 1983 + Broderbund Software + + + + + + + + + + + + + The Heist + 1983 + Micro Fun + + + + + + + + + + + + + HERO - Helicopter Emergency Rescue Operation + 1983 + Activision + + + + + + + + + + + + + Hadron + 1981 + Sirius Software + + + + + + + + + + + + + Hard Hat Mack + 1983 + Electronic Arts + + + + + + + + + + + + Hardball + 1985 + Accolade + + + + + + + + + + + + + Head On + 1980 + California Pacific Computers + + + + + + + + + + + + + High Rise + 1983 + Micro Fun + + + + + + + + + + + + + Ikari Warriors + 1983 + Data East USA + + + + + + + + + + + + + + + + + + + + Ikari Warriors 2: Victory Road + 1981 + Sirius Software + + + + + + + + + + + + + + + + + - International Gran Prix - 1982 - MUSE Software - - - - - - - - - - - - - Jawbreaker - 1981 - On-Line Systems - - - - - - - - - - - - - Jawbreaker ][ - 1982 - Sierra On-Line - - - - - - - - - - - - - The Jet - 1986 - subLOGIC - - - - - - - - - - - - - Joust - 1983 - Atarisoft - - - - - - - - - - - - - Julius Erving and Larry Bird Go One on One - 1983 - Electronic Arts - - - - - - - - - - - - - Jungle Hunt - 1984 - Atarisoft - - - - - - - - - - - - - Karate Champ - 1985 - Data East - - - - - - - - - - - - - Karateka - 1984 - Broderbund Software - - - - - - - - - - - - - - - - - - - - Kid Niki - 1987 - Data East - - - - - - - - - - - - - - - - - - - - Kung Fu Master - 1985 - Data East - - - - - - - - - - - - - L.A. Crackdown - 1988 - Epyx - - - - - - - - - - - - - - - - - - - - Lock 'n Chase - 1982 - Mattel Electronics - - - - - - - - - - - - - Lode Runner - 1983 - Broderbund - - - - - - - - - - + International Gran Prix + 1982 + MUSE Software + + + + + + + + + + + + + Jawbreaker + 1981 + On-Line Systems + + + + + + + + + + + + + Jawbreaker ][ + 1982 + Sierra On-Line + + + + + + + + + + + + + The Jet + 1986 + subLOGIC + + + + + + + + + + + + + Joust + 1983 + Atarisoft + + + + + + + + + + + + + Julius Erving and Larry Bird Go One on One + 1983 + Electronic Arts + + + + + + + + + + + + + Jungle Hunt + 1984 + Atarisoft + + + + + + + + + + + + + Karate Champ + 1985 + Data East + + + + + + + + + + + + + Karateka + 1984 + Broderbund Software + + + + + + + + + + + + + + + + + + + + Kid Niki + 1987 + Data East + + + + + + + + + + + + + + + + + + + + Kung Fu Master + 1985 + Data East + + + + + + + + + + + + + L.A. Crackdown + 1988 + Epyx + + + + + + + + + + + + + + + + + + + + Lock 'n Chase + 1982 + Mattel Electronics + + + + + + + + + + + + + Lode Runner + 1983 + Broderbund + + + + + + + + + + - Lost Tomb - 1984 - Datasoft - - - - - - - - - - - - - Marauder - 1982 - On-Line Systems - - - - - - - - - - - - - Marble Madness - 1986 - Electronic Arts - - - - - - - - - - - - - - - - - - - - Mars Cars - 1982 - Datamost - - - - - - - - - - - - - Mating Zone - 1982 - Datamost - - - - - - - - - - - - - Megabots - 1986 - Neosoft - - - - - - - - - - - - - Might and Magic - 1986 - New World Computing - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Miner 2049er - 1982 - Micro Fun - - - - - - - - - - - - - Minit Man - 1983 - Penguin Software - - - - - - - - - - - - - Impossible Mission II - 1988 - Epyx - - - - - - - - - - - - - - - - - - - - Money Muncher - 1982 - Datamost - - - - - - - - - - - - - Monster Smash - 1983 - Datamost - - - - - - - - - - - - - Montezuma's Revenge - 1984 - Parker Brothers - - - - - - - - - - - - - Moon Patrol - 1983 - Atarisoft - - - - - - - - - - - - - The Movie Monster Game - 1986 - Epyx - - - - - - - - - - - - - - - - - - - - Mr. Robot and his Robot Factory - 1984 - Datamost - - - - - - - - - - - - - Ms. Pac-Man - 1983 - Atarisoft - - - - - - - - - - - - - Night Mission Pinball - 1982 - subLOGIC - - - - - - - - - - - - - Night Stalker - 1982 - Mattel Electronics - - - - - - - - - - - - - Orbitron - 1981 - Sirius Software - - - - - - - - - - - - - O'Riley's Mine - 1981 - Datasoft - - - - - - - - - - - - - Outpost - 1981 - Sirius Software - - - - - - - - - - - - - Paperboy - 1988 - Mindscape - - - - - - - - - - - - - Pest Patrol - 1982 - Sierra On-Line - - - - - - - - - - - - - Phantoms Five - 1980 - Sirius Software - - - - - - - - - - - - - Picnic Paranoia - 1982 - Synapse Software - - - - - - - - - - - - - Pitfall II: Lost Caverns - 1984 - Activision - - - - - - - - - - - - - Pitstop II - 1984 - Epyx - - - - - - - - - - - - - Planetfall (r10) - 1988 - Infocom - - - - - - - - - - - - - - - - - - - - Plasmania - 1983 - Sirius Software - - - - - - - - - - - - - Platoon - 1988 - Data East USA - - - - - - - - - - - - - - - - - - - - Pool 1.5 - 1981 - Innovative Design Software, Inc. - - - - - - - - - - - - - Pooyan - 1984 - Datasoft - - - - - - - - - - - - - Prince of Persia - 1989 - Broderbund - - - - - - - - - - - - - - - - - - - - Qix - 1989 - Taito America - - - - - - - - - - - - - Rad Warrior - 1987 - Epyx - - - - - - - - - - - - - Rampage - 1988 - Activision - - - - - - - - - - - - - Raster Blaster - 1981 - BudgeCo - - - - - - - - - - - - - Red Alert - 1981 - Broderbund - - - - - - - - - - - - - Repton - 1982 - Sirius Software - - - - - - - - - - - - - Rescue Raiders - 1984 - Sir-Tech - - - - - - - - - - - - - RoboCop - 1988 - Data East USA - - - - - - - - - - - - - - - - - - - - Robotron 2084 - 1983 - Atarisoft - - - - - - - - - - - - - Roundabout - 1983 - Datamost - - - - - - - - - - - - - Russki Duck - 1982 - Gebelli Software - - - - - - - - - - - - - Sabotage - 1981 - On-Line Systems - - - - - - - - - - - - - Sammy Lightfoot - 1983 - Sierra On-Line - - - - - - - - - - - - - Sargon III - 1983 - Hayden Book Company - - - - - - - - - - - - - Sea Dragon - 1982 - Adventure International - - - - - - - - - - - - - Shadowkeep - 1983 - Trillium - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Shanghai - 1986 - Activision - - - - - - - - - - + Lost Tomb + 1984 + Datasoft + + + + + + + + + + + + + Marauder + 1982 + On-Line Systems + + + + + + + + + + + + + Marble Madness + 1986 + Electronic Arts + + + + + + + + + + + + + + + + + + + + Mars Cars + 1982 + Datamost + + + + + + + + + + + + + Mating Zone + 1982 + Datamost + + + + + + + + + + + + + Megabots + 1986 + Neosoft + + + + + + + + + + + + + Might and Magic + 1986 + New World Computing + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Miner 2049er + 1982 + Micro Fun + + + + + + + + + + + + + Minit Man + 1983 + Penguin Software + + + + + + + + + + + + + Impossible Mission II + 1988 + Epyx + + + + + + + + + + + + + + + + + + + + Money Muncher + 1982 + Datamost + + + + + + + + + + + + + Monster Smash + 1983 + Datamost + + + + + + + + + + + + + Montezuma's Revenge + 1984 + Parker Brothers + + + + + + + + + + + + + Moon Patrol + 1983 + Atarisoft + + + + + + + + + + + + + The Movie Monster Game + 1986 + Epyx + + + + + + + + + + + + + + + + + + + + Mr. Robot and his Robot Factory + 1984 + Datamost + + + + + + + + + + + + + Ms. Pac-Man + 1983 + Atarisoft + + + + + + + + + + + + + Night Mission Pinball + 1982 + subLOGIC + + + + + + + + + + + + + Night Stalker + 1982 + Mattel Electronics + + + + + + + + + + + + + Orbitron + 1981 + Sirius Software + + + + + + + + + + + + + O'Riley's Mine + 1981 + Datasoft + + + + + + + + + + + + + Outpost + 1981 + Sirius Software + + + + + + + + + + + + + Paperboy + 1988 + Mindscape + + + + + + + + + + + + + Pest Patrol + 1982 + Sierra On-Line + + + + + + + + + + + + + Phantoms Five + 1980 + Sirius Software + + + + + + + + + + + + + Picnic Paranoia + 1982 + Synapse Software + + + + + + + + + + + + + Pitfall II: Lost Caverns + 1984 + Activision + + + + + + + + + + + + + Pitstop II + 1984 + Epyx + + + + + + + + + + + + + Planetfall (r10) + 1988 + Infocom + + + + + + + + + + + + + + + + + + + + Plasmania + 1983 + Sirius Software + + + + + + + + + + + + + Platoon + 1988 + Data East USA + + + + + + + + + + + + + + + + + + + + Pool 1.5 + 1981 + Innovative Design Software, Inc. + + + + + + + + + + + + + Pooyan + 1984 + Datasoft + + + + + + + + + + + + + Prince of Persia + 1989 + Broderbund + + + + + + + + + + + + + + + + + + + + Qix + 1989 + Taito America + + + + + + + + + + + + + Rad Warrior + 1987 + Epyx + + + + + + + + + + + + + Rampage + 1988 + Activision + + + + + + + + + + + + + Raster Blaster + 1981 + BudgeCo + + + + + + + + + + + + + Red Alert + 1981 + Broderbund + + + + + + + + + + + + + Repton + 1982 + Sirius Software + + + + + + + + + + + + + Rescue Raiders + 1984 + Sir-Tech + + + + + + + + + + + + + RoboCop + 1988 + Data East USA + + + + + + + + + + + + + + + + + + + + Robotron 2084 + 1983 + Atarisoft + + + + + + + + + + + + + Roundabout + 1983 + Datamost + + + + + + + + + + + + + Russki Duck + 1982 + Gebelli Software + + + + + + + + + + + + + Sabotage + 1981 + On-Line Systems + + + + + + + + + + + + + Sammy Lightfoot + 1983 + Sierra On-Line + + + + + + + + + + + + + Sargon III + 1983 + Hayden Book Company + + + + + + + + + + + + + Sea Dragon + 1982 + Adventure International + + + + + + + + + + + + + Shadowkeep + 1983 + Trillium + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Shanghai + 1986 + Activision + + + + + + + + + + - Shuffleboard - 1981 - IDSI - - - - - - - - - - - - - Skyfox - 1984 - Electronic Arts - - - - - - - - - - - - - Snack Attack - 1981 - Datamost - - - - - - - - - - - - - Snake Byte - 1981 - Sirius Software - - - - - - - - - - - - - Sneakers - 1981 - Sirius Software - - - - - - - - - - - - - - Space Eggs - 1981 - Sirius Software - - - - - - - - - - - - - Space Quarks - 1981 - Broderbund Software - - - - - - - - - - - - - Spare Change - 1983 - Broderbund Software - - - - - - - - - - - - - Spiderbot - 1988 - Epyx - - - - - - - - - - - - - Spindizzy - 1986 - Activision - - - - - - - - - - - - - Spy Hunter - 1983 - Bally Midway - - - - - - - - - - - - - The Spy Strikes Back - 1983 - Penguin Software - - - - - - - - - - - - - Spy vs Spy III: Arctic Antics - 1983 - Bally Midway - - - - - - - - - - - - - Spy's Demise - 1982 - Penguin - - - - - - - - - - - - - Star Cruiser - 1980 - Sirius Software - - - - - - - - - - - - - Star Thief - 1981 - Cavalier Computer - - - - - - - - - - - - - Stellar 7 - 1984 - Penguin Software - - - - - - - - - - - - - Street Sports Baseball - 1987 - Epyx - - - - - - - - - - - - - Street Sports Basketball - 1987 - Epyx - - - - - - - - - - - - - - - - - - - - Street Sports Football - 1988 - Epyx - - - - - - - - - - - - - - - - - - - - Street Sports Soccer - 1988 - Epyx - - - - - - - - - - - - - Sub Battle Simulator - 1986 - Epyx - - - - - - - - - - - - - - - - - - - - Suicide - 1981 - Piccadilly Software - - - - - - - - - - - - - Summer Games - 1984 - Epyx - - - - - - - - - - - - - - - - - - - - Swiss Family Robinson - 1984 - Windham Classics - - - - - - - - - - - - - Tag Team Wrestling - 1986 - Data East USA - - - - - - - - - - - - - Temple of Apshai Trilogy - 1985 - Epyx - - - - - - - - - - - - - Test Drive - 1985 - Accolade - - - - - - - - - - - - - - - - - - - - Tetris (128K) - 1987 - Spectrum HoloByte - - - - - - - - - - - - - Tharolian Tunnels - 1982 - Datamost - - - - - - - - - - - - - Thunder Bombs - 1982 - Penguin Software - - - - - - - - - - - - - Thunderchopper - 1987 - ActionSoft - - - - - - - - - - - - - Tomahawk - 1987 - Datasoft - - - - - - - - - - - - - Trick Shot - 1981 - IDSI - - - - - - - - - - - - - - - - - - - - Tubeway II - 1982 - Datamost - - - - - - - - - - - - - Twerps - 1981 - Sirius Software - - - - - - - - - - - - - Ultima IV: Quest of the Avatar - 1985 - Origin Systems - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Ultima V: Warriors of Destiny - 1988 - Origin Systems - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Up 'N Down - 1981 - Bally Midway - - - - - - - - - - - - - Vindicator - 1983 - H.A.L. Labs - - - - - - - - - - - - - Wavy Navy - 1982 - Sirius Software - - - - - - - - - - - - - Wayout - 1982 - Sirius Software - - - - - - - - - - - - - Where in the USA is Carmen Sandiego - 1986 - Broderbund - - - - - - - - - - - - - - - - - - - - Wings of Fury - 1987 - Broderbund - - - - - - - - - - - - - - - - - - - - Wishbringer (r23) - 1988 - Infocom - - - - - - - - - - - - - - - - - - - - World Karate Championship - 1986 - Epyx - - - - - - - - - - - - - The World's Greatest Baseball Game - 1984 - Epyx - - - - - - - - - - - - - The World's Greatest Football Game - 1985 - Epyx - - - - - - - - - - - - - - - - - - - - Xevious - 1984 - Mindscape - - - - - - - - - - - - - Zendar - 1982 - subLOGIC - - - - - - - - - - - - - Zorro - 1985 - Datasoft - - - - - - - - - - + Shuffleboard + 1981 + IDSI + + + + + + + + + + + + + Skyfox + 1984 + Electronic Arts + + + + + + + + + + + + + Snack Attack + 1981 + Datamost + + + + + + + + + + + + + Snake Byte + 1981 + Sirius Software + + + + + + + + + + + + + Sneakers + 1981 + Sirius Software + + + + + + + + + + + + + + Space Eggs + 1981 + Sirius Software + + + + + + + + + + + + + Space Quarks + 1981 + Broderbund Software + + + + + + + + + + + + + Spare Change + 1983 + Broderbund Software + + + + + + + + + + + + + Spiderbot + 1988 + Epyx + + + + + + + + + + + + + Spindizzy + 1986 + Activision + + + + + + + + + + + + + Spy Hunter + 1983 + Bally Midway + + + + + + + + + + + + + The Spy Strikes Back + 1983 + Penguin Software + + + + + + + + + + + + + Spy vs Spy III: Arctic Antics + 1983 + Bally Midway + + + + + + + + + + + + + Spy's Demise + 1982 + Penguin + + + + + + + + + + + + + Star Cruiser + 1980 + Sirius Software + + + + + + + + + + + + + Star Thief + 1981 + Cavalier Computer + + + + + + + + + + + + + Stellar 7 + 1984 + Penguin Software + + + + + + + + + + + + + Street Sports Baseball + 1987 + Epyx + + + + + + + + + + + + + Street Sports Basketball + 1987 + Epyx + + + + + + + + + + + + + + + + + + + + Street Sports Football + 1988 + Epyx + + + + + + + + + + + + + + + + + + + + Street Sports Soccer + 1988 + Epyx + + + + + + + + + + + + + Sub Battle Simulator + 1986 + Epyx + + + + + + + + + + + + + + + + + + + + Suicide + 1981 + Piccadilly Software + + + + + + + + + + + + + Summer Games + 1984 + Epyx + + + + + + + + + + + + + + + + + + + + Swiss Family Robinson + 1984 + Windham Classics + + + + + + + + + + + + + Tag Team Wrestling + 1986 + Data East USA + + + + + + + + + + + + + Temple of Apshai Trilogy + 1985 + Epyx + + + + + + + + + + + + + Test Drive + 1985 + Accolade + + + + + + + + + + + + + + + + + + + + Tetris (128K) + 1987 + Spectrum HoloByte + + + + + + + + + + + + + Tharolian Tunnels + 1982 + Datamost + + + + + + + + + + + + + Thunder Bombs + 1982 + Penguin Software + + + + + + + + + + + + + Thunderchopper + 1987 + ActionSoft + + + + + + + + + + + + + Tomahawk + 1987 + Datasoft + + + + + + + + + + + + + Trick Shot + 1981 + IDSI + + + + + + + + + + + + + + + + + + + + Tubeway II + 1982 + Datamost + + + + + + + + + + + + + Twerps + 1981 + Sirius Software + + + + + + + + + + + + + Ultima IV: Quest of the Avatar + 1985 + Origin Systems + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ultima V: Warriors of Destiny + 1988 + Origin Systems + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Up 'N Down + 1981 + Bally Midway + + + + + + + + + + + + + Vindicator + 1983 + H.A.L. Labs + + + + + + + + + + + + + Wavy Navy + 1982 + Sirius Software + + + + + + + + + + + + + Wayout + 1982 + Sirius Software + + + + + + + + + + + + + Where in the USA is Carmen Sandiego + 1986 + Broderbund + + + + + + + + + + + + + + + + + + + + Wings of Fury + 1987 + Broderbund + + + + + + + + + + + + + + + + + + + + Wishbringer (r23) + 1988 + Infocom + + + + + + + + + + + + + + + + + + + + World Karate Championship + 1986 + Epyx + + + + + + + + + + + + + The World's Greatest Baseball Game + 1984 + Epyx + + + + + + + + + + + + + The World's Greatest Football Game + 1985 + Epyx + + + + + + + + + + + + + + + + + + + + Xevious + 1984 + Mindscape + + + + + + + + + + + + + Zendar + 1982 + subLOGIC + + + + + + + + + + + + + Zorro + 1985 + Datasoft + + + + + + + + + + diff --git a/hash/clickstart_cart.xml b/hash/clickstart_cart.xml index 156e3e16df2..43b1151435b 100644 --- a/hash/clickstart_cart.xml +++ b/hash/clickstart_cart.xml @@ -158,7 +158,7 @@ - + Toy Story (SP) 2007 @@ -171,8 +171,8 @@ - - + + Bob the Builder (UK) 2007 @@ -185,8 +185,8 @@ - - + + Thomas & Friends (UK) 2007 @@ -199,7 +199,7 @@ - + Dora the Explorer (UK) @@ -213,6 +213,6 @@ - + diff --git a/hash/ekara_japan.xml b/hash/ekara_japan.xml index 34691abfb53..a6e6faa2e08 100644 --- a/hash/ekara_japan.xml +++ b/hash/ekara_japan.xml @@ -7,9 +7,9 @@ Japanese e-kara carts appear to have a number of different genres split across various cart sub-series (often supporting different hw types) special releases etc. - + This file is for the base set (number on case, ECxxxx-xxx part numbers) - + The genres in the Japanese games are represented by the code after the EC/DC/MC/GC/PC etc. number JPM = J-Pop Mix ATS = Artist Selection (all songs by a single artist) @@ -27,21 +27,21 @@ ATM = unknown (used by the M series 'mini' carts) TPJ = TV Pop MIN = unknown - + Some Japanese carts have a number starting with S (S-x on case, SCxxxx-xxx part numbers) (see ekara_japan_s.xml) (for e-kara - custom presentation) M (M-x on case, MCxxxx-xxx part numbers) (see ekara_japan_m.xml) (for e-kara - custom presentation) - EN (EN-X on case, no part numbers) (see ekara_japan_en.xml) (for e-kara - custom presentation) (check other compatibility) + EN (EN-X on case, no part numbers) (see ekara_japan_en.xml) (for e-kara - custom presentation) (check other compatibility) G (G-x on case, GCxxxx-xxx part numbers) (see ekara_japan_g.xml) (for e-kara, Popira / 2) P (P-x on case, PCxxxx-xxx part numbers) (see ekara_japan_p.xml) (for e-kara, Popira / 2, DDR Family Mat) - D (D-x on case, DCxxxx-xxx part numbers) (see ekara_japan_d.xml) (for e-kara, Popira / 2, Taiko De Popira) + D (D-x on case, DCxxxx-xxx part numbers) (see ekara_japan_d.xml) (for e-kara, Popira / 2, Taiko De Popira) SP (SP-x on case, no part numbers) (see ekara_japan_sp.xml) (for e-kara, Popira / 2, Taiko de Popira, Jumping Popira) these exist but haven't got any Some Japanese carts have a number starting with JP (for Jumping Popira Only?) A (for Pichi Pichi Pitch Only?) KE (for Kids Lyric book device Only?) - KD (for e-kara?) - + KD (for e-kara?) + (there are others, need to document them) @@ -50,7 +50,7 @@ Genres can cross multiple cart types, eg. TV Pop 1,3,4,5,6 are in the 'G' series, while TV Pop 2 is in the 'P' series, and TV Pop 9 is in the 'D' series (where are 7,8?) for non-Japanese carts see ekara_us.xml and ekara_pal.xml, the PAL ones are noteworthy for using a different timing system - + *********************************************************************************** Japanese cart listing (by 'just number' code) (number on cartridge / box, EC in cart identifier code) @@ -312,7 +312,7 @@ - + Kid's Mix Volume 1 (Japan) (EC0010-KID) 2000 @@ -369,7 +369,7 @@ - + @@ -386,7 +386,7 @@ - + J-Pop Mix Volume 9 (Japan) (EC0021-JPM) 2000 @@ -604,7 +604,7 @@ - + @@ -740,11 +740,11 @@ - + - + - + J-Pop Mix Volume 33 (Japan) (EC0068-JPM) 2001 @@ -783,9 +783,9 @@ - - - + + + @@ -798,11 +798,11 @@ - + - + - + ETZ (Japan) (EC0079-ETZ) 2002 @@ -812,12 +812,12 @@ - - + + - + - + Matthew's Best Hit Selection (Japan) (EC0082-MBH) 2003 @@ -827,12 +827,12 @@ - - + + - + - + - + diff --git a/hash/ekara_japan_d.xml b/hash/ekara_japan_d.xml index 859ccb93a85..cfaa6844b09 100644 --- a/hash/ekara_japan_d.xml +++ b/hash/ekara_japan_d.xml @@ -21,12 +21,12 @@ D-3 DC0003-BHT BHT (Best Artists?) Volume 9? (most other BHT carts are in G series, or P series) D-4 DC0004- (unknown) *D-5 DC0005-TPJ TV Pop Volume 9 - D-6 DC0006- (seen) + D-6 DC0006- (seen) D-7 DC0007- (seen) D-8 DC0008- (seen) - + (more? what's the D highest number?) - + --> diff --git a/hash/ekara_japan_en.xml b/hash/ekara_japan_en.xml index 63533f411bb..f23b7117b31 100644 --- a/hash/ekara_japan_en.xml +++ b/hash/ekara_japan_en.xml @@ -5,11 +5,11 @@ - + EN-3 (Japan) 2004 @@ -27,6 +27,6 @@ - - + + diff --git a/hash/ekara_japan_g.xml b/hash/ekara_japan_g.xml index 1191b84109c..42acff7a551 100644 --- a/hash/ekara_japan_g.xml +++ b/hash/ekara_japan_g.xml @@ -32,7 +32,7 @@ (more? what's the G highest number?) --> - + BAT Volume 1 (Japan) (GC0001-BAT) 2000 @@ -65,7 +65,7 @@ - + BHT Volume 2 (Japan) (GC0004-BHT) 2000 @@ -76,7 +76,7 @@ - + BHT Volume 3 (Japan) (GC0006-BHT) 2000 @@ -87,18 +87,18 @@ - + + Unless Popira 2 is different (unlikely) it doesn't look like the SEEPROM in this cartridge can be used (unfinished design?) --> BAT Volume 4 (Japan) (GC0010-BAT) 2002 @@ -109,9 +109,9 @@ - - - + + + BAT Volume 5 (Japan) (GC0015-BAT) @@ -123,8 +123,8 @@ - - + + TV Pop Volume 5 (Japan) (GC0016-TPJ) 2002 @@ -135,6 +135,6 @@ - - + + diff --git a/hash/ekara_japan_m.xml b/hash/ekara_japan_m.xml index f068d1edd87..9f08af0b1e8 100644 --- a/hash/ekara_japan_m.xml +++ b/hash/ekara_japan_m.xml @@ -18,11 +18,11 @@ M-11 M-12 M-13 MC0013-KSM KSM Mini Volume 5 - + (more? what's the M highest number?) --> - + diff --git a/hash/ekara_japan_p.xml b/hash/ekara_japan_p.xml index a6736fff155..55f8c2fe06f 100644 --- a/hash/ekara_japan_p.xml +++ b/hash/ekara_japan_p.xml @@ -39,17 +39,17 @@ - + BHT Volume 7 (Japan) (PC0004-BHT) 2002 Takara - + - + - + diff --git a/hash/ekara_japan_s.xml b/hash/ekara_japan_s.xml index bf95c5d9826..ead455a7582 100644 --- a/hash/ekara_japan_s.xml +++ b/hash/ekara_japan_s.xml @@ -13,7 +13,7 @@ S-1 SC0001- Hello Kitty Special S-2 SC0002- (unknown) S-3 SC0003- (unknown) - S-4 *SC0004-SAI SAI (series 1) Volume 1 + S-4 *SC0004-SAI SAI (series 1) Volume 1 S-5 *SC0005-SAI SAI (series 2) Volume 1 (same series as 6,9,19,21,22) S-6 *SC0006-SAI SAI (series 2) Volume 2 (same series as 5,9,19,21,22) S-7 SC0007- (unknown) @@ -21,7 +21,7 @@ S-9 *SC0009-SAI SAI (series 2) Volume 3 (same series as 5,6,19,21,22) S-10 *SC0010-HWK HWK (untranslated) S-11 SC0011- (unknown) - S-12 *SC0012-SAI SAI (series 3) Volume 3 + S-12 *SC0012-SAI SAI (series 3) Volume 3 S-13 SC0013- (unknown) S-14 SC0014- (unknown) S-15 SC0015- (unknown) @@ -35,7 +35,7 @@ S-23 SC0023- (unknown) (more? what's the S highest number?) - + --> diff --git a/hash/ekara_japan_sp.xml b/hash/ekara_japan_sp.xml index efb6ea08554..d9e1bc16492 100644 --- a/hash/ekara_japan_sp.xml +++ b/hash/ekara_japan_sp.xml @@ -7,7 +7,7 @@ *********************************************************************************** Japanese cart listing (by SP code) * = dumped - + These don't seem to have a secondary numbering scheme (eg SPxxxx-xxx) These are for use with 5 different units @@ -16,14 +16,14 @@ 3. Popira 2 (Blue/Green) ( https://www.youtube.com/watch?v=iY1I-jfXw7U ) 4. Taiko de Popira 5. Jumping Popira (Stepping Mat type thing) ( https://www.youtube.com/watch?v=yJruMOBdLFY ) - + If you plug this into a DDR Family Mat you get the message (in Japanese) - + "please play this cartridge on e-kara series, popira, popira 2, taiko de popira or jumping popira" gives 'memory error' if plugged into Popira (needs cartridge SEEPROM emulating) gives 'eep-rom error' if plugged into Taiko de Popira (same reason) - + SP-01 (unknown) *SP-02 'Super Cartridge' SP-2 SP-03 (unknown) @@ -46,5 +46,5 @@ - + diff --git a/hash/ekara_us.xml b/hash/ekara_us.xml index e16a244b617..69af8ccac8d 100644 --- a/hash/ekara_us.xml +++ b/hash/ekara_us.xml @@ -229,5 +229,5 @@ - + diff --git a/hash/jakks_gamekey_dy.xml b/hash/jakks_gamekey_dy.xml index 1eb4a801760..00e041cea04 100644 --- a/hash/jakks_gamekey_dy.xml +++ b/hash/jakks_gamekey_dy.xml @@ -1,12 +1,12 @@ - + - + - + Sports Bowling & Goofy's Underwater Adventure 2005 @@ -14,9 +14,9 @@ - - - + + + @@ -28,13 +28,13 @@ - - - - + + + + - + Sports Tennis & Face Chase & Riches of Agrabah 2005 @@ -42,11 +42,11 @@ - - - - + + + + - - + + diff --git a/hash/jakks_gamekey_nk.xml b/hash/jakks_gamekey_nk.xml index d95389638ab..da91e1abcbf 100644 --- a/hash/jakks_gamekey_nk.xml +++ b/hash/jakks_gamekey_nk.xml @@ -1,9 +1,9 @@ - + - + Soccer Shootout & Juego De Futbol De Dora & Dora's Star Mountain Adventure 2005 @@ -11,9 +11,9 @@ - - - + + + diff --git a/hash/jakks_gamekey_sw.xml b/hash/jakks_gamekey_sw.xml index 1485cb87b70..831d5eb8df1 100644 --- a/hash/jakks_gamekey_sw.xml +++ b/hash/jakks_gamekey_sw.xml @@ -1,12 +1,12 @@ - + - + - + Turret Defense & Yoda's Escape 2005 @@ -20,5 +20,5 @@ - + diff --git a/hash/pce_tourvision.xml b/hash/pce_tourvision.xml index 510ebc7abd9..58b3f4ea510 100644 --- a/hash/pce_tourvision.xml +++ b/hash/pce_tourvision.xml @@ -898,10 +898,10 @@ Parasol Stars - + @@ -1041,7 +1041,7 @@ Parasol Stars Pro Yakyuu World Stadium '91 (TourVision PCE bootleg) 1991 bootleg (TourVision) / Namcot - + @@ -1067,7 +1067,7 @@ Parasol Stars Puzzle Boy (TourVision PCE bootleg) 1991 bootleg (TourVision) / Nihon Telenet - + @@ -1080,11 +1080,11 @@ Parasol Stars Puzznic (TourVision PCE bootleg) 1990 bootleg (TourVision) / Taito - + - + @@ -1123,7 +1123,7 @@ Parasol Stars - + diff --git a/hash/vsmile_cart.xml b/hash/vsmile_cart.xml index bb7ab418a3a..f097cf4ded7 100644 --- a/hash/vsmile_cart.xml +++ b/hash/vsmile_cart.xml @@ -1892,7 +1892,7 @@ Game cartridges - + Superman - Der Superheld (Ger) 200? diff --git a/hash/vtech_storio_cart.xml b/hash/vtech_storio_cart.xml index 32d6e17d970..1d901cf1ff0 100644 --- a/hash/vtech_storio_cart.xml +++ b/hash/vtech_storio_cart.xml @@ -1,10 +1,10 @@ - + - +