trunk/src/tools/nltool.c
| r242978 | r242979 | |
| 18 | 18 | #include "netlist/nl_base.h" |
| 19 | 19 | #include "netlist/nl_setup.h" |
| 20 | 20 | #include "netlist/nl_parser.h" |
| 21 | #include "netlist/nl_factory.h" |
| 21 | 22 | #include "netlist/nl_util.h" |
| 23 | #include "netlist/devices/net_lib.h" |
| 22 | 24 | #include "options.h" |
| 23 | 25 | |
| 24 | 26 | /*************************************************************************** |
| 25 | | MAME COMPATIBILITY ... |
| 26 | | ***************************************************************************/ |
| 27 | * MAME COMPATIBILITY ... |
| 28 | * |
| 29 | * These are needed if we link without libutil |
| 30 | ***************************************************************************/ |
| 27 | 31 | |
| 28 | 32 | #if 0 |
| 29 | 33 | void ATTR_PRINTF(1,2) osd_printf_warning(const char *format, ...) |
| r242978 | r242979 | |
| 35 | 39 | vprintf(format, argptr); |
| 36 | 40 | va_end(argptr); |
| 37 | 41 | } |
| 38 | | #endif |
| 39 | 42 | |
| 40 | 43 | void *malloc_file_line(size_t size, const char *file, int line) |
| 41 | 44 | { |
| r242978 | r242979 | |
| 72 | 75 | src_type.name(), dst_type.name()); |
| 73 | 76 | throw; |
| 74 | 77 | } |
| 78 | #endif |
| 75 | 79 | |
| 76 | 80 | struct options_entry oplist[] = |
| 77 | 81 | { |
| r242978 | r242979 | |
| 83 | 87 | { NULL } |
| 84 | 88 | }; |
| 85 | 89 | |
| 90 | NETLIST_START(dummy) |
| 91 | /* Standard stuff */ |
| 92 | |
| 93 | CLOCK(clk, 1000) // 1000 Hz |
| 94 | SOLVER(Solver, 48000) |
| 95 | |
| 96 | NETLIST_END() |
| 97 | |
| 86 | 98 | /*************************************************************************** |
| 87 | 99 | CORE IMPLEMENTATION |
| 88 | 100 | ***************************************************************************/ |
| r242978 | r242979 | |
| 160 | 172 | nl_util::pstring_list ll = nl_util::split(m_logs, ":"); |
| 161 | 173 | for (int i=0; i < ll.count(); i++) |
| 162 | 174 | { |
| 163 | | netlist_device_t *nc = m_setup->factory().new_device_by_classname("nld_log", *m_setup); |
| 164 | | pstring name = "log_" + ll[i]; |
| 165 | | m_setup->register_dev(nc, name); |
| 175 | pstring name = "log_" + ll[i]; |
| 176 | netlist_device_t *nc = m_setup->register_dev("nld_log", name); |
| 166 | 177 | m_setup->register_link(name + ".I", ll[i]); |
| 167 | 178 | } |
| 168 | 179 | } |
| r242978 | r242979 | |
| 230 | 241 | nt.init(); |
| 231 | 242 | const netlist_factory_t::list_t &list = nt.setup().factory().list(); |
| 232 | 243 | |
| 244 | netlist_sources_t sources; |
| 245 | |
| 246 | sources.add(netlist_source_t("dummy", &netlist_dummy)); |
| 247 | sources.parse(nt.setup(),"dummy"); |
| 248 | |
| 233 | 249 | nt.setup().start_devices(); |
| 234 | 250 | nt.setup().resolve_inputs(); |
| 235 | 251 | |