trunk/src/emu/machine/netlist.c
| r26795 | r26796 | |
| 54 | 54 | //#define LOG_DEV_CALLS(x) printf x |
| 55 | 55 | #define LOG_DEV_CALLS(x) do { } while (0) |
| 56 | 56 | |
| 57 | | const device_type NETLIST = &device_creator<netlist_mame_device_t>; |
| 57 | const device_type NETLIST_CORE = &device_creator<netlist_mame_device_t>; |
| 58 | const device_type NETLIST_CPU = &device_creator<netlist_mame_cpu_device_t>; |
| 58 | 59 | const device_type NETLIST_ANALOG_INPUT = &device_creator<netlist_mame_analog_input_t>; |
| 59 | 60 | const device_type NETLIST_LOGIC_INPUT = &device_creator<netlist_mame_logic_input_t>; |
| 60 | 61 | |
| 62 | // ---------------------------------------------------------------------------------------- |
| 63 | // netlist_mame_analog_input_t |
| 64 | // ---------------------------------------------------------------------------------------- |
| 65 | |
| 61 | 66 | netlist_mame_analog_input_t::netlist_mame_analog_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 62 | 67 | : device_t(mconfig, NETLIST_ANALOG_INPUT, "netlist analog input", tag, owner, clock, "netlist_analog_input", __FILE__), |
| 63 | 68 | netlist_mame_sub_interface(*this), |
| 69 | m_param(0), |
| 64 | 70 | m_offset(0.0), |
| 65 | 71 | m_mult(1.0), |
| 66 | 72 | m_auto_port(true), |
| r26795 | r26796 | |
| 97 | 103 | netlist_mame_logic_input_t::netlist_mame_logic_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 98 | 104 | : device_t(mconfig, NETLIST_ANALOG_INPUT, "netlist analog input", tag, owner, clock, "netlist_analog_input", __FILE__), |
| 99 | 105 | netlist_mame_sub_interface(*this), |
| 106 | m_param(0), |
| 100 | 107 | m_mask(0xffffffff), |
| 101 | 108 | m_shift(0), |
| 102 | 109 | m_param_name("") |
| r26795 | r26796 | |
| 124 | 131 | |
| 125 | 132 | |
| 126 | 133 | // ---------------------------------------------------------------------------------------- |
| 127 | | // netlist_mame_device |
| 134 | // netlist_mame_device_t |
| 128 | 135 | // ---------------------------------------------------------------------------------------- |
| 129 | 136 | |
| 130 | 137 | static ADDRESS_MAP_START(program_dummy, AS_PROGRAM, 8, netlist_mame_device_t) |
| r26795 | r26796 | |
| 132 | 139 | ADDRESS_MAP_END |
| 133 | 140 | |
| 134 | 141 | netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 135 | | : device_t(mconfig, NETLIST, "netlist", tag, owner, clock, "netlist_mame", __FILE__), |
| 136 | | device_execute_interface(mconfig, *this), |
| 137 | | device_state_interface(mconfig, *this), |
| 138 | | device_disasm_interface(mconfig, *this), |
| 139 | | device_memory_interface(mconfig, *this), |
| 140 | | m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0, ADDRESS_MAP_NAME(program_dummy)), |
| 141 | | m_netlist(NULL), |
| 142 | | m_setup(NULL), |
| 143 | | m_setup_func(NULL), |
| 144 | | m_icount(0), |
| 145 | | m_genPC(0) |
| 142 | : device_t(mconfig, NETLIST_CORE, "Netlist core device", tag, owner, clock, "netlist_core", __FILE__), |
| 143 | m_netlist(NULL), |
| 144 | m_setup(NULL), |
| 145 | m_setup_func(NULL) |
| 146 | 146 | { |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *file) |
| 150 | : device_t(mconfig, type, name, tag, owner, clock, shortname, file), |
| 151 | m_netlist(NULL), |
| 152 | m_setup(NULL), |
| 153 | m_setup_func(NULL) |
| 154 | { |
| 155 | } |
| 156 | |
| 149 | 157 | void netlist_mame_device_t::static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &)) |
| 150 | 158 | { |
| 151 | 159 | LOG_DEV_CALLS(("static_set_constructor\n")); |
| r26795 | r26796 | |
| 164 | 172 | |
| 165 | 173 | m_netlist = global_alloc_clear(netlist_mame_t(*this)); |
| 166 | 174 | m_setup = global_alloc_clear(netlist_setup_t(*m_netlist)); |
| 167 | | m_netlist->init_object(*m_netlist, "netlist"); |
| 175 | netlist().init_object(*m_netlist, "netlist"); |
| 168 | 176 | m_setup->init(); |
| 169 | 177 | |
| 170 | | m_netlist->set_clock_freq(this->clock()); |
| 178 | netlist().set_clock_freq(this->clock()); |
| 171 | 179 | |
| 172 | 180 | // register additional devices |
| 173 | 181 | |
| r26795 | r26796 | |
| 191 | 199 | |
| 192 | 200 | save_state(); |
| 193 | 201 | |
| 194 | | // State support |
| 195 | | |
| 196 | | state_add(STATE_GENPC, "curpc", m_genPC).noshow(); |
| 197 | | |
| 198 | | for (int i=0; i < m_netlist->m_nets.count(); i++) |
| 199 | | { |
| 200 | | netlist_net_t *n = m_netlist->m_nets[i]; |
| 201 | | if (n->isRailNet()) |
| 202 | | { |
| 203 | | state_add(i*2, n->name(), n->Q_state_ptr()); |
| 204 | | } |
| 205 | | else |
| 206 | | { |
| 207 | | state_add(i*2+1, n->name(), n->Q_Analog_state_ptr()).formatstr("%20s"); |
| 208 | | } |
| 209 | | } |
| 210 | | |
| 211 | | // set our instruction counter |
| 212 | | m_icountptr = &m_icount; |
| 213 | 202 | } |
| 214 | 203 | |
| 215 | 204 | void netlist_mame_device_t::device_reset() |
| 216 | 205 | { |
| 217 | 206 | LOG_DEV_CALLS(("device_reset\n")); |
| 218 | | m_netlist->reset(); |
| 207 | netlist().reset(); |
| 219 | 208 | } |
| 220 | 209 | |
| 221 | 210 | void netlist_mame_device_t::device_stop() |
| r26795 | r26796 | |
| 233 | 222 | { |
| 234 | 223 | LOG_DEV_CALLS(("device_post_load\n")); |
| 235 | 224 | |
| 236 | | m_netlist->post_load(); |
| 225 | netlist().post_load(); |
| 237 | 226 | } |
| 238 | 227 | |
| 239 | 228 | ATTR_COLD void netlist_mame_device_t::device_pre_save() |
| 240 | 229 | { |
| 241 | 230 | LOG_DEV_CALLS(("device_pre_save\n")); |
| 242 | 231 | |
| 243 | | m_netlist->pre_save(); |
| 232 | netlist().pre_save(); |
| 244 | 233 | } |
| 245 | 234 | |
| 246 | 235 | void netlist_mame_device_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 247 | 236 | { |
| 248 | 237 | } |
| 249 | 238 | |
| 250 | | |
| 251 | | |
| 252 | 239 | ATTR_COLD void netlist_mame_device_t::save_state() |
| 253 | 240 | { |
| 254 | | for (pstate_entry_t::list_t::entry_t *p = m_netlist->save_list().first(); p != NULL; p = m_netlist->save_list().next(p)) |
| 241 | for (pstate_entry_t::list_t::entry_t *p = netlist().save_list().first(); p != NULL; p = netlist().save_list().next(p)) |
| 255 | 242 | { |
| 256 | 243 | pstate_entry_t *s = p->object(); |
| 257 | 244 | NL_VERBOSE_OUT(("saving state for %s\n", s->m_name.cstr())); |
| r26795 | r26796 | |
| 275 | 262 | case DT_CUSTOM: |
| 276 | 263 | case NOT_SUPPORTED: |
| 277 | 264 | default: |
| 278 | | m_netlist->xfatalerror("found unsupported save element %s\n", s->m_name.cstr()); |
| 265 | netlist().xfatalerror("found unsupported save element %s\n", s->m_name.cstr()); |
| 279 | 266 | break; |
| 280 | 267 | } |
| 281 | 268 | } |
| 282 | 269 | |
| 283 | 270 | } |
| 284 | 271 | |
| 285 | | ATTR_COLD UINT64 netlist_mame_device_t::execute_clocks_to_cycles(UINT64 clocks) const |
| 272 | // ---------------------------------------------------------------------------------------- |
| 273 | // netlist_mame_cpu_device_t |
| 274 | // ---------------------------------------------------------------------------------------- |
| 275 | |
| 276 | netlist_mame_cpu_device_t::netlist_mame_cpu_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 277 | : netlist_mame_device_t(mconfig, NETLIST_CPU, "Netlist cpu device", tag, owner, clock, "netlist_cpu", __FILE__), |
| 278 | device_execute_interface(mconfig, *this), |
| 279 | device_state_interface(mconfig, *this), |
| 280 | device_disasm_interface(mconfig, *this), |
| 281 | device_memory_interface(mconfig, *this), |
| 282 | m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0, ADDRESS_MAP_NAME(program_dummy)), |
| 283 | m_icount(0) |
| 286 | 284 | { |
| 285 | } |
| 286 | |
| 287 | |
| 288 | void netlist_mame_cpu_device_t::device_start() |
| 289 | { |
| 290 | netlist_mame_device_t::device_start(); |
| 291 | |
| 292 | LOG_DEV_CALLS(("device_start %s\n", tag())); |
| 293 | |
| 294 | // State support |
| 295 | |
| 296 | state_add(STATE_GENPC, "curpc", m_genPC).noshow(); |
| 297 | |
| 298 | for (int i=0; i < netlist().m_nets.count(); i++) |
| 299 | { |
| 300 | netlist_net_t *n = netlist().m_nets[i]; |
| 301 | if (n->isRailNet()) |
| 302 | { |
| 303 | state_add(i*2, n->name(), n->Q_state_ptr()); |
| 304 | } |
| 305 | else |
| 306 | { |
| 307 | state_add(i*2+1, n->name(), n->Q_Analog_state_ptr()).formatstr("%20s"); |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | // set our instruction counter |
| 312 | m_icountptr = &m_icount; |
| 313 | } |
| 314 | |
| 315 | ATTR_COLD UINT64 netlist_mame_cpu_device_t::execute_clocks_to_cycles(UINT64 clocks) const |
| 316 | { |
| 287 | 317 | return clocks; |
| 288 | 318 | } |
| 289 | 319 | |
| 290 | | ATTR_COLD UINT64 netlist_mame_device_t::execute_cycles_to_clocks(UINT64 cycles) const |
| 320 | ATTR_COLD UINT64 netlist_mame_cpu_device_t::execute_cycles_to_clocks(UINT64 cycles) const |
| 291 | 321 | { |
| 292 | 322 | return cycles; |
| 293 | 323 | } |
| 294 | 324 | |
| 295 | | ATTR_COLD offs_t netlist_mame_device_t::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) |
| 325 | ATTR_COLD offs_t netlist_mame_cpu_device_t::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options) |
| 296 | 326 | { |
| 297 | 327 | //char tmp[16]; |
| 298 | 328 | unsigned startpc = pc; |
| r26795 | r26796 | |
| 300 | 330 | //UINT16 opcode = (oprom[pc - startpc] << 8) | oprom[pc+1 - startpc]; |
| 301 | 331 | //UINT8 inst = opcode >> 13; |
| 302 | 332 | |
| 303 | | if (relpc >= 0 && relpc < m_netlist->queue().count()) |
| 333 | if (relpc >= 0 && relpc < netlist().queue().count()) |
| 304 | 334 | { |
| 305 | | // sprintf(buffer, "%04x %02d %s", pc, relpc, m_netlist->queue()[m_netlist->queue().count() - relpc - 1].object().name().cstr()); |
| 306 | | int dpc = m_netlist->queue().count() - relpc - 1; |
| 307 | | sprintf(buffer, "%c %s @%10.7f", (relpc == 0) ? '*' : ' ', m_netlist->queue()[dpc].object().name().cstr(), |
| 308 | | m_netlist->queue()[dpc].time().as_double()); |
| 335 | // sprintf(buffer, "%04x %02d %s", pc, relpc, netlist().queue()[netlist().queue().count() - relpc - 1].object().name().cstr()); |
| 336 | int dpc = netlist().queue().count() - relpc - 1; |
| 337 | sprintf(buffer, "%c %s @%10.7f", (relpc == 0) ? '*' : ' ', netlist().queue()[dpc].object().name().cstr(), |
| 338 | netlist().queue()[dpc].time().as_double()); |
| 309 | 339 | } |
| 310 | 340 | else |
| 311 | 341 | sprintf(buffer, "%s", ""); |
| r26795 | r26796 | |
| 313 | 343 | return (pc - startpc); |
| 314 | 344 | } |
| 315 | 345 | |
| 316 | | ATTR_HOT void netlist_mame_device_t::execute_run() |
| 346 | ATTR_HOT void netlist_mame_cpu_device_t::execute_run() |
| 317 | 347 | { |
| 318 | 348 | bool check_debugger = ((device_t::machine().debug_flags & DEBUG_FLAG_ENABLED) != 0); |
| 319 | 349 | // debugging |
| r26795 | r26796 | |
| 326 | 356 | m_genPC++; |
| 327 | 357 | m_genPC &= 255; |
| 328 | 358 | debugger_instruction_hook(this, m_genPC); |
| 329 | | m_netlist->process_queue(m_temp); |
| 359 | netlist().process_queue(m_temp); |
| 330 | 360 | m_icount -= (1 - m_temp); |
| 331 | 361 | } |
| 332 | 362 | } |
| 333 | 363 | else |
| 334 | | m_netlist->process_queue(m_icount); |
| 364 | netlist().process_queue(m_icount); |
| 335 | 365 | } |
trunk/src/emu/machine/netlist.h
| r26795 | r26796 | |
| 57 | 57 | // MAME specific configuration |
| 58 | 58 | |
| 59 | 59 | #define MCFG_NETLIST_ADD(_tag, _setup ) \ |
| 60 | | MCFG_DEVICE_ADD(_tag, NETLIST, NETLIST_CLOCK) \ |
| 60 | MCFG_DEVICE_ADD(_tag, NETLIST_CPU, NETLIST_CLOCK) \ |
| 61 | 61 | MCFG_NETLIST_SETUP(_setup) |
| 62 | 62 | |
| 63 | 63 | #define MCFG_NETLIST_REPLACE(_tag, _setup) \ |
| 64 | | MCFG_DEVICE_REPLACE(_tag, NETLIST, NETLIST_CLOCK) \ |
| 64 | MCFG_DEVICE_REPLACE(_tag, NETLIST_CPU, NETLIST_CLOCK) \ |
| 65 | 65 | MCFG_NETLIST_SETUP(_setup) |
| 66 | 66 | |
| 67 | 67 | #define MCFG_NETLIST_SETUP(_setup) \ |
| r26795 | r26796 | |
| 134 | 134 | // netlist_mame_device_t |
| 135 | 135 | // ---------------------------------------------------------------------------------------- |
| 136 | 136 | |
| 137 | | class netlist_mame_device_t : public device_t, |
| 138 | | public device_execute_interface, |
| 139 | | public device_state_interface, |
| 140 | | public device_disasm_interface, |
| 141 | | public device_memory_interface |
| 137 | class netlist_mame_device_t : public device_t |
| 142 | 138 | { |
| 143 | 139 | public: |
| 144 | 140 | |
| 145 | 141 | // construction/destruction |
| 146 | 142 | netlist_mame_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 143 | netlist_mame_device_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *file); |
| 147 | 144 | virtual ~netlist_mame_device_t() {} |
| 148 | 145 | |
| 149 | 146 | static void static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &)); |
| 150 | 147 | |
| 151 | | netlist_setup_t &setup() { return *m_setup; } |
| 152 | | netlist_mame_t &netlist() { return *m_netlist; } |
| 148 | ATTR_HOT inline netlist_setup_t &setup() { return *m_setup; } |
| 149 | ATTR_HOT inline netlist_mame_t &netlist() { return *m_netlist; } |
| 153 | 150 | |
| 154 | 151 | protected: |
| 155 | | // device-level overrides |
| 152 | // device_t overrides |
| 156 | 153 | virtual void device_config_complete(); |
| 157 | 154 | virtual void device_start(); |
| 158 | 155 | virtual void device_stop(); |
| r26795 | r26796 | |
| 160 | 157 | virtual void device_post_load(); |
| 161 | 158 | virtual void device_pre_save(); |
| 162 | 159 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 163 | | virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const; |
| 164 | | virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const; |
| 165 | 160 | |
| 166 | | ATTR_HOT virtual void execute_run(); |
| 161 | private: |
| 162 | void save_state(); |
| 167 | 163 | |
| 168 | | // device_disasm_interface overrides |
| 169 | | ATTR_COLD virtual UINT32 disasm_min_opcode_bytes() const { return 1; } |
| 170 | | ATTR_COLD virtual UINT32 disasm_max_opcode_bytes() const { return 1; } |
| 171 | | ATTR_COLD virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); |
| 164 | netlist_mame_t *m_netlist; |
| 165 | netlist_setup_t *m_setup; |
| 172 | 166 | |
| 173 | | // device_memory_interface overrides |
| 167 | void (*m_setup_func)(netlist_setup_t &); |
| 168 | }; |
| 174 | 169 | |
| 175 | | address_space_config m_program_config; |
| 170 | inline running_machine &netlist_mame_t::machine() |
| 171 | { |
| 172 | return m_parent.machine(); |
| 173 | } |
| 176 | 174 | |
| 177 | | virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const |
| 178 | | { |
| 179 | | switch (spacenum) |
| 180 | | { |
| 181 | | case AS_PROGRAM: return &m_program_config; |
| 182 | | case AS_IO: return NULL; |
| 183 | | default: return NULL; |
| 184 | | } |
| 185 | | } |
| 175 | // ---------------------------------------------------------------------------------------- |
| 176 | // netlist_mame_cpu_device_t |
| 177 | // ---------------------------------------------------------------------------------------- |
| 186 | 178 | |
| 187 | | virtual void state_string_export(const device_state_entry &entry, astring &string) |
| 188 | | { |
| 189 | | if (entry.index() >= 0) |
| 190 | | { |
| 191 | | if (entry.index() & 1) |
| 192 | | string.format("%10.6f", *((double *) entry.dataptr())); |
| 193 | | else |
| 194 | | string.format("%d", *((netlist_sig_t *) entry.dataptr())); |
| 195 | | } |
| 196 | | } |
| 179 | class netlist_mame_cpu_device_t : public netlist_mame_device_t, |
| 180 | public device_execute_interface, |
| 181 | public device_state_interface, |
| 182 | public device_disasm_interface, |
| 183 | public device_memory_interface |
| 184 | { |
| 185 | public: |
| 197 | 186 | |
| 187 | // construction/destruction |
| 188 | netlist_mame_cpu_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 189 | virtual ~netlist_mame_cpu_device_t() {} |
| 198 | 190 | |
| 199 | | netlist_mame_t *m_netlist; |
| 200 | | netlist_setup_t *m_setup; |
| 191 | static void static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &)); |
| 201 | 192 | |
| 202 | | private: |
| 193 | protected: |
| 194 | // device_t overrides |
| 195 | //virtual void device_config_complete(); |
| 196 | virtual void device_start(); |
| 197 | //virtual void device_stop(); |
| 198 | //virtual void device_reset(); |
| 199 | //virtual void device_post_load(); |
| 200 | //virtual void device_pre_save(); |
| 201 | //virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 203 | 202 | |
| 204 | | void save_state(); |
| 203 | // device_execute_interface overrides |
| 205 | 204 | |
| 206 | | void (*m_setup_func)(netlist_setup_t &); |
| 205 | virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const; |
| 206 | virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const; |
| 207 | 207 | |
| 208 | | int m_icount; |
| 209 | | int m_genPC; |
| 208 | ATTR_HOT virtual void execute_run(); |
| 210 | 209 | |
| 210 | // device_disasm_interface overrides |
| 211 | ATTR_COLD virtual UINT32 disasm_min_opcode_bytes() const { return 1; } |
| 212 | ATTR_COLD virtual UINT32 disasm_max_opcode_bytes() const { return 1; } |
| 213 | ATTR_COLD virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options); |
| 214 | |
| 215 | // device_memory_interface overrides |
| 216 | |
| 217 | address_space_config m_program_config; |
| 218 | |
| 219 | virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const |
| 220 | { |
| 221 | switch (spacenum) |
| 222 | { |
| 223 | case AS_PROGRAM: return &m_program_config; |
| 224 | case AS_IO: return NULL; |
| 225 | default: return NULL; |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | // device_state_interface overrides |
| 230 | |
| 231 | virtual void state_string_export(const device_state_entry &entry, astring &string) |
| 232 | { |
| 233 | if (entry.index() >= 0) |
| 234 | { |
| 235 | if (entry.index() & 1) |
| 236 | string.format("%10.6f", *((double *) entry.dataptr())); |
| 237 | else |
| 238 | string.format("%d", *((netlist_sig_t *) entry.dataptr())); |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | private: |
| 243 | |
| 244 | int m_icount; |
| 245 | int m_genPC; |
| 246 | |
| 211 | 247 | }; |
| 212 | 248 | |
| 213 | | inline running_machine &netlist_mame_t::machine() |
| 214 | | { |
| 215 | | return m_parent.machine(); |
| 216 | | } |
| 217 | | |
| 218 | 249 | // ---------------------------------------------------------------------------------------- |
| 219 | 250 | // netlist_mame_sub_interface |
| 220 | 251 | // ---------------------------------------------------------------------------------------- |
| r26795 | r26796 | |
| 327 | 358 | { |
| 328 | 359 | register_input("IN", m_in); |
| 329 | 360 | m_callback.bind_relative_to(downcast<netlist_mame_t &>(netlist()).machine().root_device()); |
| 361 | m_cpu_device = downcast<netlist_mame_cpu_device_t *>(&downcast<netlist_mame_t &>(netlist()).parent()); |
| 330 | 362 | } |
| 331 | 363 | |
| 332 | 364 | ATTR_COLD void register_callback(netlist_analog_output_delegate callback) |
| r26795 | r26796 | |
| 336 | 368 | |
| 337 | 369 | ATTR_HOT void update() |
| 338 | 370 | { |
| 339 | | // FIXME: Remove after device cleanup |
| 340 | | if (!m_callback.isnull()) |
| 341 | | m_callback(INPANALOG(m_in), downcast<netlist_mame_t &>(netlist()).parent().local_time()); |
| 371 | m_callback(INPANALOG(m_in), m_cpu_device->local_time()); |
| 342 | 372 | } |
| 343 | 373 | |
| 344 | 374 | private: |
| 345 | 375 | netlist_analog_input_t m_in; |
| 346 | 376 | netlist_analog_output_delegate m_callback; |
| 377 | netlist_mame_cpu_device_t *m_cpu_device; |
| 347 | 378 | }; |
| 348 | 379 | |
| 349 | 380 | class NETLIB_NAME(sound) : public netlist_device_t |
| r26795 | r26796 | |
| 393 | 424 | |
| 394 | 425 | |
| 395 | 426 | // device type definition |
| 396 | | extern const device_type NETLIST; |
| 427 | extern const device_type NETLIST_CORE; |
| 428 | extern const device_type NETLIST_CPU; |
| 397 | 429 | extern const device_type NETLIST_ANALOG_INPUT; |
| 398 | 430 | extern const device_type NETLIST_LOGIC_INPUT; |
| 399 | 431 | |