mirror of
https://github.com/holub/mame
synced 2025-10-05 16:50:57 +03:00
Alignment of netlist with MAME standards. Inputs to netlist are now registered using by MCFG_* as mame subdevices and exhibit the usual writeXX/readXX methods including a PORT_CHANGED method. This allows direct linking to inputs. [Couriersud]
This commit is contained in:
parent
383b1196db
commit
8ca799371f
@ -54,24 +54,90 @@
|
||||
//#define LOG_DEV_CALLS(x) printf x
|
||||
#define LOG_DEV_CALLS(x) do { } while (0)
|
||||
|
||||
const device_type NETLIST = &device_creator<netlist_mame_device_t>;
|
||||
const device_type NETLIST_ANALOG_INPUT = &device_creator<netlist_mame_analog_input_t>;
|
||||
const device_type NETLIST_LOGIC_INPUT = &device_creator<netlist_mame_logic_input_t>;
|
||||
|
||||
netlist_mame_analog_input_t::netlist_mame_analog_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, NETLIST_ANALOG_INPUT, "netlist analog input", tag, owner, clock, "netlist_analog_input", __FILE__),
|
||||
netlist_mame_sub_interface(*this),
|
||||
m_offset(0.0),
|
||||
m_mult(1.0),
|
||||
m_auto_port(true),
|
||||
m_param_name("")
|
||||
{
|
||||
}
|
||||
|
||||
void netlist_mame_analog_input_t::static_set_name(device_t &device, const char *param_name)
|
||||
{
|
||||
netlist_mame_analog_input_t &netlist = downcast<netlist_mame_analog_input_t &>(device);
|
||||
netlist.m_param_name = param_name;
|
||||
}
|
||||
|
||||
void netlist_mame_analog_input_t::static_set_mult_offset(device_t &device, const double mult, const double offset)
|
||||
{
|
||||
netlist_mame_analog_input_t &netlist = downcast<netlist_mame_analog_input_t &>(device);
|
||||
netlist.m_mult = mult;
|
||||
netlist.m_offset = offset;
|
||||
// disable automatic scaling for ioports
|
||||
netlist.m_auto_port = false;
|
||||
}
|
||||
|
||||
void netlist_mame_analog_input_t::device_start()
|
||||
{
|
||||
LOG_DEV_CALLS(("start %s\n", tag()));
|
||||
netlist_param_t *p = downcast<netlist_mame_device_t *>(this->owner())->setup().find_param(m_param_name);
|
||||
m_param = dynamic_cast<netlist_param_double_t *>(p);
|
||||
if (m_param == NULL)
|
||||
{
|
||||
fatalerror("device %s wrong parameter type for %s\n", basetag(), m_param_name.cstr());
|
||||
}
|
||||
}
|
||||
|
||||
netlist_mame_logic_input_t::netlist_mame_logic_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, NETLIST_ANALOG_INPUT, "netlist analog input", tag, owner, clock, "netlist_analog_input", __FILE__),
|
||||
netlist_mame_sub_interface(*this),
|
||||
m_mask(0xffffffff),
|
||||
m_shift(0),
|
||||
m_param_name("")
|
||||
{
|
||||
}
|
||||
|
||||
void netlist_mame_logic_input_t::static_set_params(device_t &device, const char *param_name, const UINT32 mask, const UINT32 shift)
|
||||
{
|
||||
netlist_mame_logic_input_t &netlist = downcast<netlist_mame_logic_input_t &>(device);
|
||||
netlist.m_param_name = param_name;
|
||||
netlist.m_shift = shift;
|
||||
netlist.m_mask = mask;
|
||||
}
|
||||
|
||||
void netlist_mame_logic_input_t::device_start()
|
||||
{
|
||||
LOG_DEV_CALLS(("start %s\n", tag()));
|
||||
netlist_param_t *p = downcast<netlist_mame_device_t *>(this->owner())->setup().find_param(m_param_name);
|
||||
m_param = dynamic_cast<netlist_param_int_t *>(p);
|
||||
if (m_param == NULL)
|
||||
{
|
||||
fatalerror("device %s wrong parameter type for %s\n", basetag(), m_param_name.cstr());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
// netlist_mame_device
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
const device_type NETLIST = &device_creator<netlist_mame_device>;
|
||||
|
||||
static ADDRESS_MAP_START(program_dummy, AS_PROGRAM, 8, netlist_mame_device)
|
||||
AM_RANGE(0x000, 0x3ff) AM_ROM
|
||||
static ADDRESS_MAP_START(program_dummy, AS_PROGRAM, 8, netlist_mame_device_t)
|
||||
AM_RANGE(0x000, 0x3ff) AM_ROM
|
||||
ADDRESS_MAP_END
|
||||
|
||||
netlist_mame_device::netlist_mame_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
netlist_mame_device_t::netlist_mame_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, NETLIST, "netlist", tag, owner, clock, "netlist_mame", __FILE__),
|
||||
device_execute_interface(mconfig, *this),
|
||||
device_state_interface(mconfig, *this),
|
||||
device_disasm_interface(mconfig, *this),
|
||||
device_memory_interface(mconfig, *this),
|
||||
m_device_start_list(100),
|
||||
m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0, ADDRESS_MAP_NAME(program_dummy)),
|
||||
device_state_interface(mconfig, *this),
|
||||
device_disasm_interface(mconfig, *this),
|
||||
device_memory_interface(mconfig, *this),
|
||||
m_program_config("program", ENDIANNESS_LITTLE, 8, 12, 0, ADDRESS_MAP_NAME(program_dummy)),
|
||||
m_netlist(NULL),
|
||||
m_setup(NULL),
|
||||
m_setup_func(NULL),
|
||||
@ -80,21 +146,21 @@ netlist_mame_device::netlist_mame_device(const machine_config &mconfig, const ch
|
||||
{
|
||||
}
|
||||
|
||||
void netlist_mame_device::static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &))
|
||||
void netlist_mame_device_t::static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &))
|
||||
{
|
||||
netlist_mame_device &netlist = downcast<netlist_mame_device &>(device);
|
||||
netlist.m_setup_func = setup_func;
|
||||
LOG_DEV_CALLS(("static_set_constructor\n"));
|
||||
netlist_mame_device_t &netlist = downcast<netlist_mame_device_t &>(device);
|
||||
netlist.m_setup_func = setup_func;
|
||||
}
|
||||
|
||||
void netlist_mame_device::device_config_complete()
|
||||
void netlist_mame_device_t::device_config_complete()
|
||||
{
|
||||
LOG_DEV_CALLS(("device_config_complete\n"));
|
||||
}
|
||||
|
||||
void netlist_mame_device::device_start()
|
||||
void netlist_mame_device_t::device_start()
|
||||
{
|
||||
LOG_DEV_CALLS(("device_start\n"));
|
||||
LOG_DEV_CALLS(("device_start %s\n", tag()));
|
||||
|
||||
m_netlist = global_alloc_clear(netlist_mame_t(*this));
|
||||
m_setup = global_alloc_clear(netlist_setup_t(*m_netlist));
|
||||
@ -109,46 +175,50 @@ void netlist_mame_device::device_start()
|
||||
|
||||
m_setup_func(*m_setup);
|
||||
|
||||
/* let sub-devices tweak the netlist */
|
||||
for( device_t *d = this->first_subdevice(); d != NULL; d = d->next() )
|
||||
{
|
||||
netlist_mame_sub_interface *sdev = dynamic_cast<netlist_mame_sub_interface *>(d);
|
||||
if( sdev != NULL )
|
||||
{
|
||||
LOG_DEV_CALLS(("Found subdevice %s/%s\n", d->name(), d->shortname()));
|
||||
sdev->custom_netlist_additions(*m_netlist);
|
||||
}
|
||||
}
|
||||
|
||||
m_setup->start_devices();
|
||||
m_setup->resolve_inputs();
|
||||
|
||||
bool allok = true;
|
||||
for (device_start_list_t::entry_t *ods = m_device_start_list.first(); ods != NULL; ods = m_device_start_list.next(ods))
|
||||
allok &= ods->object()->OnDeviceStart();
|
||||
|
||||
if (!allok)
|
||||
m_netlist->xfatalerror("required elements not found\n");
|
||||
|
||||
save_state();
|
||||
|
||||
// State support
|
||||
|
||||
state_add(STATE_GENPC, "curpc", m_genPC).noshow();
|
||||
state_add(STATE_GENPC, "curpc", m_genPC).noshow();
|
||||
|
||||
for (int i=0; i < m_netlist->m_nets.count(); i++)
|
||||
{
|
||||
netlist_net_t *n = m_netlist->m_nets[i];
|
||||
if (n->isRailNet())
|
||||
{
|
||||
state_add(i*2, n->name(), n->m_cur.Q);
|
||||
}
|
||||
else
|
||||
{
|
||||
state_add(i*2+1, n->name(), n->m_cur.Analog).formatstr("%20s");
|
||||
}
|
||||
}
|
||||
for (int i=0; i < m_netlist->m_nets.count(); i++)
|
||||
{
|
||||
netlist_net_t *n = m_netlist->m_nets[i];
|
||||
if (n->isRailNet())
|
||||
{
|
||||
state_add(i*2, n->name(), n->m_cur.Q);
|
||||
}
|
||||
else
|
||||
{
|
||||
state_add(i*2+1, n->name(), n->m_cur.Analog).formatstr("%20s");
|
||||
}
|
||||
}
|
||||
|
||||
// set our instruction counter
|
||||
m_icountptr = &m_icount;
|
||||
}
|
||||
|
||||
void netlist_mame_device::device_reset()
|
||||
void netlist_mame_device_t::device_reset()
|
||||
{
|
||||
LOG_DEV_CALLS(("device_reset\n"));
|
||||
m_netlist->reset();
|
||||
}
|
||||
|
||||
void netlist_mame_device::device_stop()
|
||||
void netlist_mame_device_t::device_stop()
|
||||
{
|
||||
LOG_DEV_CALLS(("device_stop\n"));
|
||||
m_setup->print_stats();
|
||||
@ -159,108 +229,107 @@ void netlist_mame_device::device_stop()
|
||||
m_netlist = NULL;
|
||||
}
|
||||
|
||||
ATTR_COLD void netlist_mame_device::device_post_load()
|
||||
ATTR_COLD void netlist_mame_device_t::device_post_load()
|
||||
{
|
||||
LOG_DEV_CALLS(("device_post_load\n"));
|
||||
LOG_DEV_CALLS(("device_post_load\n"));
|
||||
|
||||
m_netlist->post_load();
|
||||
m_netlist->post_load();
|
||||
}
|
||||
|
||||
ATTR_COLD void netlist_mame_device::device_pre_save()
|
||||
ATTR_COLD void netlist_mame_device_t::device_pre_save()
|
||||
{
|
||||
LOG_DEV_CALLS(("device_pre_save\n"));
|
||||
|
||||
m_netlist->pre_save();
|
||||
}
|
||||
|
||||
void netlist_mame_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
void netlist_mame_device_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
ATTR_COLD void netlist_mame_device::save_state()
|
||||
ATTR_COLD void netlist_mame_device_t::save_state()
|
||||
{
|
||||
for (pstate_entry_t::list_t::entry_t *p = m_netlist->save_list().first(); p != NULL; p = m_netlist->save_list().next(p))
|
||||
{
|
||||
pstate_entry_t *s = p->object();
|
||||
NL_VERBOSE_OUT(("saving state for %s\n", s->m_name.cstr()));
|
||||
switch (s->m_dt)
|
||||
{
|
||||
case DT_DOUBLE:
|
||||
save_pointer((double *) s->m_ptr, s->m_name, s->m_count);
|
||||
break;
|
||||
case DT_INT64:
|
||||
save_pointer((INT64 *) s->m_ptr, s->m_name, s->m_count);
|
||||
break;
|
||||
case DT_INT8:
|
||||
save_pointer((INT8 *) s->m_ptr, s->m_name, s->m_count);
|
||||
break;
|
||||
case DT_INT:
|
||||
save_pointer((int *) s->m_ptr, s->m_name, s->m_count);
|
||||
break;
|
||||
case DT_BOOLEAN:
|
||||
save_pointer((bool *) s->m_ptr, s->m_name, s->m_count);
|
||||
break;
|
||||
case DT_CUSTOM:
|
||||
case NOT_SUPPORTED:
|
||||
default:
|
||||
m_netlist->xfatalerror("found unsupported save element %s\n", s->m_name.cstr());
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (pstate_entry_t::list_t::entry_t *p = m_netlist->save_list().first(); p != NULL; p = m_netlist->save_list().next(p))
|
||||
{
|
||||
pstate_entry_t *s = p->object();
|
||||
NL_VERBOSE_OUT(("saving state for %s\n", s->m_name.cstr()));
|
||||
switch (s->m_dt)
|
||||
{
|
||||
case DT_DOUBLE:
|
||||
save_pointer((double *) s->m_ptr, s->m_name, s->m_count);
|
||||
break;
|
||||
case DT_INT64:
|
||||
save_pointer((INT64 *) s->m_ptr, s->m_name, s->m_count);
|
||||
break;
|
||||
case DT_INT8:
|
||||
save_pointer((INT8 *) s->m_ptr, s->m_name, s->m_count);
|
||||
break;
|
||||
case DT_INT:
|
||||
save_pointer((int *) s->m_ptr, s->m_name, s->m_count);
|
||||
break;
|
||||
case DT_BOOLEAN:
|
||||
save_pointer((bool *) s->m_ptr, s->m_name, s->m_count);
|
||||
break;
|
||||
case DT_CUSTOM:
|
||||
case NOT_SUPPORTED:
|
||||
default:
|
||||
m_netlist->xfatalerror("found unsupported save element %s\n", s->m_name.cstr());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ATTR_COLD UINT64 netlist_mame_device::execute_clocks_to_cycles(UINT64 clocks) const
|
||||
ATTR_COLD UINT64 netlist_mame_device_t::execute_clocks_to_cycles(UINT64 clocks) const
|
||||
{
|
||||
return clocks;
|
||||
}
|
||||
|
||||
ATTR_COLD UINT64 netlist_mame_device::execute_cycles_to_clocks(UINT64 cycles) const
|
||||
ATTR_COLD UINT64 netlist_mame_device_t::execute_cycles_to_clocks(UINT64 cycles) const
|
||||
{
|
||||
return cycles;
|
||||
}
|
||||
|
||||
ATTR_COLD offs_t netlist_mame_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
|
||||
ATTR_COLD offs_t netlist_mame_device_t::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options)
|
||||
{
|
||||
//char tmp[16];
|
||||
unsigned startpc = pc;
|
||||
int relpc = pc - m_genPC;
|
||||
//UINT16 opcode = (oprom[pc - startpc] << 8) | oprom[pc+1 - startpc];
|
||||
//UINT8 inst = opcode >> 13;
|
||||
//char tmp[16];
|
||||
unsigned startpc = pc;
|
||||
int relpc = pc - m_genPC;
|
||||
//UINT16 opcode = (oprom[pc - startpc] << 8) | oprom[pc+1 - startpc];
|
||||
//UINT8 inst = opcode >> 13;
|
||||
|
||||
if (relpc >= 0 && relpc < m_netlist->queue().count())
|
||||
{
|
||||
// sprintf(buffer, "%04x %02d %s", pc, relpc, m_netlist->queue()[m_netlist->queue().count() - relpc - 1].object().name().cstr());
|
||||
int dpc = m_netlist->queue().count() - relpc - 1;
|
||||
sprintf(buffer, "%c %s @%10.7f", (relpc == 0) ? '*' : ' ', m_netlist->queue()[dpc].object().name().cstr(),
|
||||
m_netlist->queue()[dpc].time().as_double());
|
||||
}
|
||||
else
|
||||
sprintf(buffer, "%s", "");
|
||||
pc+=1;
|
||||
return (pc - startpc);
|
||||
if (relpc >= 0 && relpc < m_netlist->queue().count())
|
||||
{
|
||||
// sprintf(buffer, "%04x %02d %s", pc, relpc, m_netlist->queue()[m_netlist->queue().count() - relpc - 1].object().name().cstr());
|
||||
int dpc = m_netlist->queue().count() - relpc - 1;
|
||||
sprintf(buffer, "%c %s @%10.7f", (relpc == 0) ? '*' : ' ', m_netlist->queue()[dpc].object().name().cstr(),
|
||||
m_netlist->queue()[dpc].time().as_double());
|
||||
}
|
||||
else
|
||||
sprintf(buffer, "%s", "");
|
||||
pc+=1;
|
||||
return (pc - startpc);
|
||||
}
|
||||
|
||||
ATTR_HOT void netlist_mame_device::execute_run()
|
||||
ATTR_HOT void netlist_mame_device_t::execute_run()
|
||||
{
|
||||
bool check_debugger = ((device_t::machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
|
||||
// debugging
|
||||
//m_ppc = m_pc; // copy PC to previous PC
|
||||
if (check_debugger)
|
||||
{
|
||||
while (m_icount > 0)
|
||||
{
|
||||
int m_temp = 1;
|
||||
m_genPC++;
|
||||
m_genPC &= 255;
|
||||
debugger_instruction_hook(this, m_genPC);
|
||||
m_netlist->process_queue(m_temp);
|
||||
m_icount -= (1 - m_temp);
|
||||
}
|
||||
while (m_icount > 0)
|
||||
{
|
||||
int m_temp = 1;
|
||||
m_genPC++;
|
||||
m_genPC &= 255;
|
||||
debugger_instruction_hook(this, m_genPC);
|
||||
m_netlist->process_queue(m_temp);
|
||||
m_icount -= (1 - m_temp);
|
||||
}
|
||||
}
|
||||
else
|
||||
m_netlist->process_queue(m_icount);
|
||||
m_netlist->process_queue(m_icount);
|
||||
}
|
||||
|
||||
|
@ -59,11 +59,30 @@
|
||||
#define MCFG_NETLIST_ADD(_tag, _setup ) \
|
||||
MCFG_DEVICE_ADD(_tag, NETLIST, NETLIST_CLOCK) \
|
||||
MCFG_NETLIST_SETUP(_setup)
|
||||
|
||||
#define MCFG_NETLIST_REPLACE(_tag, _setup) \
|
||||
MCFG_DEVICE_REPLACE(_tag, NETLIST, NETLIST_CLOCK) \
|
||||
MCFG_NETLIST_SETUP(_setup)
|
||||
|
||||
#define MCFG_NETLIST_SETUP(_setup) \
|
||||
netlist_mame_device::static_set_constructor(*device, NETLIST_NAME(_setup));
|
||||
netlist_mame_device_t::static_set_constructor(*device, NETLIST_NAME(_setup));
|
||||
|
||||
#define MCFG_NETLIST_ANALOG_INPUT(_basetag, _tag, _name) \
|
||||
MCFG_DEVICE_ADD(_basetag ":" _tag, NETLIST_ANALOG_INPUT, 0) \
|
||||
netlist_mame_analog_input_t::static_set_name(*device, _name);
|
||||
|
||||
#define MCFG_NETLIST_ANALOG_INPUT_MULT_OFFSET(_mult, _offset) \
|
||||
netlist_mame_analog_input_t::static_set_mult_offset(*device, _mult, _offset);
|
||||
|
||||
#define NETLIST_ANALOG_PORT_CHANGED(_base, _tag) \
|
||||
PORT_CHANGED_MEMBER(_base ":" _tag, netlist_mame_analog_input_t, input_changed, 0)
|
||||
|
||||
#define MCFG_NETLIST_LOGIC_INPUT(_basetag, _tag, _name, _shift, _mask) \
|
||||
MCFG_DEVICE_ADD(_basetag ":" _tag, NETLIST_LOGIC_INPUT, 0) \
|
||||
netlist_mame_logic_input_t::static_set_params(*device, _name, _mask, _shift);
|
||||
|
||||
#define NETLIST_LOGIC_PORT_CHANGED(_base, _tag) \
|
||||
PORT_CHANGED_MEMBER(_base ":" _tag, netlist_mame_logic_input_t, input_changed, 0)
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
// Extensions to interface netlist with MAME code ....
|
||||
@ -83,13 +102,13 @@
|
||||
#define NETDEV_ANALOG_CALLBACK_MEMBER(_name) \
|
||||
void _name(const double data, const attotime &time)
|
||||
|
||||
class netlist_mame_device;
|
||||
class netlist_mame_device_t;
|
||||
|
||||
class netlist_mame_t : public netlist_base_t
|
||||
{
|
||||
public:
|
||||
|
||||
netlist_mame_t(netlist_mame_device &parent)
|
||||
netlist_mame_t(netlist_mame_device_t &parent)
|
||||
: netlist_base_t(),
|
||||
m_parent(parent)
|
||||
{}
|
||||
@ -97,7 +116,7 @@ public:
|
||||
|
||||
inline running_machine &machine();
|
||||
|
||||
netlist_mame_device &parent() { return m_parent; }
|
||||
netlist_mame_device_t &parent() { return m_parent; }
|
||||
|
||||
protected:
|
||||
|
||||
@ -108,51 +127,30 @@ protected:
|
||||
}
|
||||
|
||||
private:
|
||||
netlist_mame_device &m_parent;
|
||||
netlist_mame_device_t &m_parent;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
// MAME glue classes
|
||||
// netlist_mame_device_t
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
// ======================> netlist_mame_device
|
||||
|
||||
class netlist_mame_device : public device_t,
|
||||
public device_execute_interface,
|
||||
public device_state_interface,
|
||||
public device_disasm_interface,
|
||||
public device_memory_interface
|
||||
class netlist_mame_device_t : public device_t,
|
||||
public device_execute_interface,
|
||||
public device_state_interface,
|
||||
public device_disasm_interface,
|
||||
public device_memory_interface
|
||||
{
|
||||
public:
|
||||
|
||||
template<bool _Required, class _NETClass>
|
||||
class output_finder;
|
||||
template<class C>
|
||||
class optional_output;
|
||||
template<class C>
|
||||
class required_output;
|
||||
template<class C>
|
||||
class optional_param;
|
||||
template<class C>
|
||||
class required_param;
|
||||
class on_device_start;
|
||||
|
||||
// construction/destruction
|
||||
netlist_mame_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
virtual ~netlist_mame_device() {}
|
||||
netlist_mame_device_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
virtual ~netlist_mame_device_t() {}
|
||||
|
||||
static void static_set_constructor(device_t &device, void (*setup_func)(netlist_setup_t &));
|
||||
|
||||
netlist_setup_t &setup() { return *m_setup; }
|
||||
netlist_mame_t &netlist() { return *m_netlist; }
|
||||
|
||||
typedef netlist_list_t<on_device_start *> device_start_list_t;
|
||||
|
||||
device_start_list_t m_device_start_list;
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_config_complete();
|
||||
@ -167,35 +165,35 @@ protected:
|
||||
|
||||
ATTR_HOT virtual void execute_run();
|
||||
|
||||
// device_disasm_interface overrides
|
||||
ATTR_COLD virtual UINT32 disasm_min_opcode_bytes() const { return 1; }
|
||||
ATTR_COLD virtual UINT32 disasm_max_opcode_bytes() const { return 1; }
|
||||
ATTR_COLD virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
|
||||
// device_disasm_interface overrides
|
||||
ATTR_COLD virtual UINT32 disasm_min_opcode_bytes() const { return 1; }
|
||||
ATTR_COLD virtual UINT32 disasm_max_opcode_bytes() const { return 1; }
|
||||
ATTR_COLD virtual offs_t disasm_disassemble(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram, UINT32 options);
|
||||
|
||||
// device_memory_interface overrides
|
||||
// device_memory_interface overrides
|
||||
|
||||
address_space_config m_program_config;
|
||||
address_space_config m_program_config;
|
||||
|
||||
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const
|
||||
{
|
||||
switch (spacenum)
|
||||
{
|
||||
case AS_PROGRAM: return &m_program_config;
|
||||
case AS_IO: return NULL;
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
virtual const address_space_config *memory_space_config(address_spacenum spacenum = AS_0) const
|
||||
{
|
||||
switch (spacenum)
|
||||
{
|
||||
case AS_PROGRAM: return &m_program_config;
|
||||
case AS_IO: return NULL;
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
virtual void state_string_export(const device_state_entry &entry, astring &string)
|
||||
{
|
||||
if (entry.index() >= 0)
|
||||
{
|
||||
if (entry.index() & 1)
|
||||
string.format("%10.6f", *((double *) entry.dataptr()));
|
||||
else
|
||||
string.format("%d", *((netlist_sig_t *) entry.dataptr()));
|
||||
}
|
||||
}
|
||||
virtual void state_string_export(const device_state_entry &entry, astring &string)
|
||||
{
|
||||
if (entry.index() >= 0)
|
||||
{
|
||||
if (entry.index() & 1)
|
||||
string.format("%10.6f", *((double *) entry.dataptr()));
|
||||
else
|
||||
string.format("%d", *((netlist_sig_t *) entry.dataptr()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
netlist_mame_t *m_netlist;
|
||||
@ -208,9 +206,7 @@ private:
|
||||
void (*m_setup_func)(netlist_setup_t &);
|
||||
|
||||
int m_icount;
|
||||
int m_genPC;
|
||||
|
||||
|
||||
int m_genPC;
|
||||
|
||||
};
|
||||
|
||||
@ -219,6 +215,102 @@ inline running_machine &netlist_mame_t::machine()
|
||||
return m_parent.machine();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
// netlist_mame_sub_interface
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
class netlist_mame_sub_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
netlist_mame_sub_interface(netlist_mame_device_t &obj) : m_object(obj) {}
|
||||
virtual ~netlist_mame_sub_interface() { }
|
||||
|
||||
virtual void custom_netlist_additions(netlist_base_t &netlist) { }
|
||||
|
||||
inline netlist_mame_device_t &object() { return m_object; }
|
||||
private:
|
||||
netlist_mame_device_t &m_object;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
// netlist_mame_analog_input_t
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
class netlist_mame_analog_input_t : public device_t,
|
||||
public netlist_mame_sub_interface
|
||||
{
|
||||
public:
|
||||
|
||||
// construction/destruction
|
||||
netlist_mame_analog_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
virtual ~netlist_mame_analog_input_t() { }
|
||||
|
||||
static void static_set_name(device_t &device, const char *param_name);
|
||||
static void static_set_mult_offset(device_t &device, const double mult, const double offset);
|
||||
|
||||
inline void write(const double val) { m_param->setTo(val * m_mult + m_offset); }
|
||||
|
||||
inline DECLARE_INPUT_CHANGED_MEMBER(input_changed)
|
||||
{
|
||||
if (m_auto_port)
|
||||
write(((double) newval - (double) field.minval())/((double) (field.maxval()-field.minval()) ) );
|
||||
else
|
||||
write(newval);
|
||||
}
|
||||
inline DECLARE_WRITE_LINE_MEMBER(write_line) { write(state); }
|
||||
inline DECLARE_WRITE8_MEMBER(write8) { write(data); }
|
||||
inline DECLARE_WRITE16_MEMBER(write16) { write(data); }
|
||||
inline DECLARE_WRITE32_MEMBER(write32) { write(data); }
|
||||
inline DECLARE_WRITE64_MEMBER(write64) { write(data); }
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
private:
|
||||
netlist_param_double_t *m_param;
|
||||
double m_offset;
|
||||
double m_mult;
|
||||
bool m_auto_port;
|
||||
pstring m_param_name;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
// netlist_mame_logic_input_t
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
class netlist_mame_logic_input_t : public device_t,
|
||||
public netlist_mame_sub_interface
|
||||
{
|
||||
public:
|
||||
|
||||
// construction/destruction
|
||||
netlist_mame_logic_input_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
virtual ~netlist_mame_logic_input_t() { }
|
||||
|
||||
static void static_set_params(device_t &device, const char *param_name, const UINT32 mask, const UINT32 shift);
|
||||
|
||||
inline void write(const UINT32 val) { m_param->setTo((val >> m_shift) & m_mask); }
|
||||
|
||||
inline DECLARE_INPUT_CHANGED_MEMBER(input_changed) { write(newval); }
|
||||
DECLARE_WRITE_LINE_MEMBER(write_line) { write(state); }
|
||||
DECLARE_WRITE8_MEMBER(write8) { write(data); }
|
||||
DECLARE_WRITE16_MEMBER(write16) { write(data); }
|
||||
DECLARE_WRITE32_MEMBER(write32) { write(data); }
|
||||
DECLARE_WRITE64_MEMBER(write64) { write(data); }
|
||||
|
||||
protected:
|
||||
// device-level overrides
|
||||
virtual void device_start();
|
||||
|
||||
private:
|
||||
netlist_param_int_t *m_param;
|
||||
UINT32 m_mask;
|
||||
UINT32 m_shift;
|
||||
pstring m_param_name;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
// netdev_callback
|
||||
// ----------------------------------------------------------------------------------------
|
||||
@ -300,110 +392,9 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// ======================> netlist_output_finder
|
||||
|
||||
class netlist_mame_device::on_device_start
|
||||
{
|
||||
public:
|
||||
virtual bool OnDeviceStart() = 0;
|
||||
virtual ~on_device_start() {}
|
||||
};
|
||||
|
||||
// device finder template
|
||||
template<bool _Required, class _NETClass>
|
||||
class netlist_mame_device::output_finder : public object_finder_base<_NETClass>,
|
||||
netlist_mame_device::on_device_start
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
output_finder(device_t &base, const char *tag, const char *output)
|
||||
: object_finder_base<_NETClass>(base, tag), m_netlist(NULL), m_output(output) { }
|
||||
|
||||
// finder
|
||||
virtual bool findit(bool isvalidation = false)
|
||||
{
|
||||
if (isvalidation) return true;
|
||||
device_t *device = this->m_base.subdevice(this->m_tag);
|
||||
m_netlist = dynamic_cast<netlist_mame_device *>(device);
|
||||
if (device != NULL && m_netlist == NULL)
|
||||
{
|
||||
void mame_printf_warning(const char *format, ...) ATTR_PRINTF(1,2);
|
||||
mame_printf_warning("Device '%s' found but is not netlist\n", this->m_tag);
|
||||
}
|
||||
m_netlist->m_device_start_list.add(this);
|
||||
return this->report_missing(m_netlist != NULL, "device", _Required);
|
||||
}
|
||||
|
||||
protected:
|
||||
netlist_mame_device *m_netlist;
|
||||
const char *m_output;
|
||||
};
|
||||
|
||||
// optional device finder
|
||||
template<class C>
|
||||
class netlist_mame_device::optional_output : public netlist_mame_device::output_finder<false, C>
|
||||
{
|
||||
public:
|
||||
optional_output(device_t &base, const char *tag, const char *output) : output_finder<false, C>(base, tag, output) { }
|
||||
|
||||
virtual ~optional_output() {};
|
||||
|
||||
virtual bool OnDeviceStart()
|
||||
{
|
||||
this->m_target = dynamic_cast<C *>(this->m_netlist->setup().find_terminal(this->m_output, netlist_object_t::OUTPUT, false));
|
||||
return this->report_missing(this->m_target != NULL, "output", false);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// required devices are similar but throw an error if they are not found
|
||||
template<class C>
|
||||
class netlist_mame_device::required_output : public netlist_mame_device::output_finder<true, C>
|
||||
{
|
||||
public:
|
||||
required_output(device_t &base, const char *tag, const char *output) : output_finder<true, C>(base, tag, output) { }
|
||||
|
||||
virtual ~required_output() {};
|
||||
|
||||
virtual bool OnDeviceStart()
|
||||
{
|
||||
this->m_target = dynamic_cast<C *>(this->m_netlist->setup().find_terminal(this->m_output, netlist_object_t::OUTPUT));
|
||||
return this->report_missing(this->m_target != NULL, "output", true);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// optional device finder
|
||||
template<class C>
|
||||
class netlist_mame_device::optional_param : public netlist_mame_device::output_finder<false, C>
|
||||
{
|
||||
public:
|
||||
optional_param(device_t &base, const char *tag, const char *output) : output_finder<false, C>(base, tag, output) { }
|
||||
|
||||
virtual bool OnDeviceStart()
|
||||
{
|
||||
this->m_target = dynamic_cast<C *>(this->m_netlist->setup().find_param(this->m_output, false));
|
||||
return this->report_missing(this->m_target != NULL, "parameter", false);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// required devices are similar but throw an error if they are not found
|
||||
template<class C>
|
||||
class netlist_mame_device::required_param : public netlist_mame_device::output_finder<true, C>
|
||||
{
|
||||
public:
|
||||
required_param(device_t &base, const char *tag, const char *output) : output_finder<true, C>(base, tag, output) { }
|
||||
|
||||
virtual bool OnDeviceStart()
|
||||
{
|
||||
this->m_target = dynamic_cast<C *>( this->m_netlist->setup().find_param(this->m_output));
|
||||
return this->report_missing(this->m_target != NULL, "parameter", true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
extern const device_type NETLIST;
|
||||
extern const device_type NETLIST_ANALOG_INPUT;
|
||||
extern const device_type NETLIST_LOGIC_INPUT;
|
||||
|
||||
#endif
|
||||
|
@ -7,87 +7,87 @@
|
||||
|
||||
NETLIB_START(nic74107Asub)
|
||||
{
|
||||
register_input("CLK", m_clk, netlist_input_t::STATE_INP_HL);
|
||||
register_output("Q", m_Q);
|
||||
register_output("QQ", m_QQ);
|
||||
register_input("CLK", m_clk, netlist_input_t::STATE_INP_HL);
|
||||
register_output("Q", m_Q);
|
||||
register_output("QQ", m_QQ);
|
||||
|
||||
m_Q.initial(0);
|
||||
m_QQ.initial(1);
|
||||
m_Q.initial(0);
|
||||
m_QQ.initial(1);
|
||||
|
||||
m_Q1 = 0;
|
||||
m_Q2 = 0;
|
||||
m_F = 0;
|
||||
m_Q1 = 0;
|
||||
m_Q2 = 0;
|
||||
m_F = 0;
|
||||
|
||||
save(NAME(m_Q1));
|
||||
save(NAME(m_Q2));
|
||||
save(NAME(m_F));
|
||||
save(NAME(m_Q1));
|
||||
save(NAME(m_Q2));
|
||||
save(NAME(m_F));
|
||||
}
|
||||
|
||||
NETLIB_START(nic74107A)
|
||||
{
|
||||
register_sub(sub, "sub");
|
||||
register_sub(sub, "sub");
|
||||
|
||||
register_subalias("CLK", sub.m_clk);
|
||||
register_input("J", m_J);
|
||||
register_input("K", m_K);
|
||||
register_input("CLRQ", m_clrQ);
|
||||
register_subalias("Q", sub.m_Q);
|
||||
register_subalias("QQ", sub.m_QQ);
|
||||
register_subalias("CLK", sub.m_clk);
|
||||
register_input("J", m_J);
|
||||
register_input("K", m_K);
|
||||
register_input("CLRQ", m_clrQ);
|
||||
register_subalias("Q", sub.m_Q);
|
||||
register_subalias("QQ", sub.m_QQ);
|
||||
|
||||
}
|
||||
|
||||
ATTR_HOT inline void NETLIB_NAME(nic74107Asub)::newstate(const netlist_sig_t state)
|
||||
{
|
||||
const netlist_time delay[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) };
|
||||
const netlist_time delay[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) };
|
||||
|
||||
OUTLOGIC(m_Q, state, delay[state ^ 1]);
|
||||
OUTLOGIC(m_QQ, state ^ 1, delay[state]);
|
||||
OUTLOGIC(m_Q, state, delay[state ^ 1]);
|
||||
OUTLOGIC(m_QQ, state ^ 1, delay[state]);
|
||||
}
|
||||
|
||||
NETLIB_UPDATE(nic74107Asub)
|
||||
{
|
||||
const netlist_sig_t t = m_Q.net().Q();
|
||||
newstate((!t & m_Q1) | (t & m_Q2) | m_F);
|
||||
if (!m_Q1)
|
||||
m_clk.inactivate();
|
||||
const netlist_sig_t t = m_Q.net().Q();
|
||||
newstate((!t & m_Q1) | (t & m_Q2) | m_F);
|
||||
if (!m_Q1)
|
||||
m_clk.inactivate();
|
||||
}
|
||||
|
||||
NETLIB_UPDATE(nic74107A)
|
||||
{
|
||||
const UINT8 JK = (INPLOGIC(m_J) << 1) | INPLOGIC(m_K);
|
||||
const UINT8 JK = (INPLOGIC(m_J) << 1) | INPLOGIC(m_K);
|
||||
|
||||
switch (JK)
|
||||
{
|
||||
case 0:
|
||||
sub.m_Q1 = 0;
|
||||
sub.m_Q2 = 1;
|
||||
sub.m_F = 0;
|
||||
sub.m_clk.inactivate();
|
||||
break;
|
||||
case 1: // (!INPLOGIC(m_J) & INPLOGIC(m_K))
|
||||
sub.m_Q1 = 0;
|
||||
sub.m_Q2 = 0;
|
||||
sub.m_F = 0;
|
||||
break;
|
||||
case 2: // (INPLOGIC(m_J) & !INPLOGIC(m_K))
|
||||
sub.m_Q1 = 0;
|
||||
sub.m_Q2 = 0;
|
||||
sub.m_F = 1;
|
||||
break;
|
||||
case 3: // (INPLOGIC(m_J) & INPLOGIC(m_K))
|
||||
sub.m_Q1 = 1;
|
||||
sub.m_Q2 = 0;
|
||||
sub.m_F = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
switch (JK)
|
||||
{
|
||||
case 0:
|
||||
sub.m_Q1 = 0;
|
||||
sub.m_Q2 = 1;
|
||||
sub.m_F = 0;
|
||||
sub.m_clk.inactivate();
|
||||
break;
|
||||
case 1: // (!INPLOGIC(m_J) & INPLOGIC(m_K))
|
||||
sub.m_Q1 = 0;
|
||||
sub.m_Q2 = 0;
|
||||
sub.m_F = 0;
|
||||
break;
|
||||
case 2: // (INPLOGIC(m_J) & !INPLOGIC(m_K))
|
||||
sub.m_Q1 = 0;
|
||||
sub.m_Q2 = 0;
|
||||
sub.m_F = 1;
|
||||
break;
|
||||
case 3: // (INPLOGIC(m_J) & INPLOGIC(m_K))
|
||||
sub.m_Q1 = 1;
|
||||
sub.m_Q2 = 0;
|
||||
sub.m_F = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!INPLOGIC(m_clrQ))
|
||||
{
|
||||
sub.m_clk.inactivate();
|
||||
sub.newstate(0);
|
||||
}
|
||||
else if (!sub.m_Q2)
|
||||
sub.m_clk.activate_hl();
|
||||
if (!INPLOGIC(m_clrQ))
|
||||
{
|
||||
sub.m_clk.inactivate();
|
||||
sub.newstate(0);
|
||||
}
|
||||
else if (!sub.m_Q2)
|
||||
sub.m_clk.activate_hl();
|
||||
}
|
||||
|
@ -62,43 +62,43 @@
|
||||
#include "../nl_base.h"
|
||||
|
||||
#define TTL_74107A(_name, _CLK, _J, _K, _CLRQ) \
|
||||
NET_REGISTER_DEV(nic74107A, _name) \
|
||||
NET_CONNECT(_name, CLK, _CLK) \
|
||||
NET_CONNECT(_name, J, _J) \
|
||||
NET_CONNECT(_name, K, _K) \
|
||||
NET_CONNECT(_name, CLRQ, _CLRQ)
|
||||
NET_REGISTER_DEV(nic74107A, _name) \
|
||||
NET_CONNECT(_name, CLK, _CLK) \
|
||||
NET_CONNECT(_name, J, _J) \
|
||||
NET_CONNECT(_name, K, _K) \
|
||||
NET_CONNECT(_name, CLRQ, _CLRQ)
|
||||
|
||||
#define TTL_74107(_name, _CLK, _J, _K, _CLRQ) \
|
||||
TTL_74107A(_name, _CLK, _J, _K, _CLRQ)
|
||||
TTL_74107A(_name, _CLK, _J, _K, _CLRQ)
|
||||
|
||||
NETLIB_SUBDEVICE(nic74107Asub,
|
||||
netlist_ttl_input_t m_clk;
|
||||
netlist_ttl_input_t m_clk;
|
||||
|
||||
netlist_ttl_output_t m_Q;
|
||||
netlist_ttl_output_t m_QQ;
|
||||
netlist_ttl_output_t m_Q;
|
||||
netlist_ttl_output_t m_QQ;
|
||||
|
||||
netlist_sig_t m_Q1;
|
||||
netlist_sig_t m_Q2;
|
||||
netlist_sig_t m_F;
|
||||
netlist_sig_t m_Q1;
|
||||
netlist_sig_t m_Q2;
|
||||
netlist_sig_t m_F;
|
||||
|
||||
ATTR_HOT void newstate(const netlist_sig_t state);
|
||||
ATTR_HOT void newstate(const netlist_sig_t state);
|
||||
|
||||
);
|
||||
|
||||
NETLIB_DEVICE(nic74107A,
|
||||
NETLIB_NAME(nic74107Asub) sub;
|
||||
NETLIB_NAME(nic74107Asub) sub;
|
||||
|
||||
netlist_ttl_input_t m_J;
|
||||
netlist_ttl_input_t m_K;
|
||||
netlist_ttl_input_t m_clrQ;
|
||||
netlist_ttl_input_t m_J;
|
||||
netlist_ttl_input_t m_K;
|
||||
netlist_ttl_input_t m_clrQ;
|
||||
|
||||
);
|
||||
|
||||
class NETLIB_NAME(nic74107) : public NETLIB_NAME(nic74107A)
|
||||
{
|
||||
public:
|
||||
NETLIB_NAME(nic74107) ()
|
||||
: NETLIB_NAME(nic74107A) () {}
|
||||
NETLIB_NAME(nic74107) ()
|
||||
: NETLIB_NAME(nic74107A) () {}
|
||||
|
||||
};
|
||||
|
||||
|
@ -7,15 +7,15 @@
|
||||
|
||||
NETLIB_START(nic74153)
|
||||
{
|
||||
register_input("C0", m_C[0]);
|
||||
register_input("C1", m_C[1]);
|
||||
register_input("C2", m_C[2]);
|
||||
register_input("C3", m_C[3]);
|
||||
register_input("A", m_A);
|
||||
register_input("B", m_B);
|
||||
register_input("G", m_G);
|
||||
register_input("C0", m_C[0]);
|
||||
register_input("C1", m_C[1]);
|
||||
register_input("C2", m_C[2]);
|
||||
register_input("C3", m_C[3]);
|
||||
register_input("A", m_A);
|
||||
register_input("B", m_B);
|
||||
register_input("G", m_G);
|
||||
|
||||
register_output("AY", m_Y); //FIXME: Change netlists
|
||||
register_output("AY", m_Y); //FIXME: Change netlists
|
||||
}
|
||||
|
||||
/* FIXME: timing is not 100% accurate, Strobe and Select inputs have a
|
||||
@ -25,17 +25,15 @@ NETLIB_START(nic74153)
|
||||
|
||||
NETLIB_UPDATE(nic74153)
|
||||
{
|
||||
const netlist_time delay[2] = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) };
|
||||
if (!INPLOGIC(m_G))
|
||||
{
|
||||
UINT8 chan = (INPLOGIC(m_A) | (INPLOGIC(m_B)<<1));
|
||||
UINT8 t = INPLOGIC(m_C[chan]);
|
||||
OUTLOGIC(m_Y, t, delay[t] );
|
||||
}
|
||||
else
|
||||
{
|
||||
OUTLOGIC(m_Y, 0, delay[0]);
|
||||
}
|
||||
const netlist_time delay[2] = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) };
|
||||
if (!INPLOGIC(m_G))
|
||||
{
|
||||
UINT8 chan = (INPLOGIC(m_A) | (INPLOGIC(m_B)<<1));
|
||||
UINT8 t = INPLOGIC(m_C[chan]);
|
||||
OUTLOGIC(m_Y, t, delay[t] );
|
||||
}
|
||||
else
|
||||
{
|
||||
OUTLOGIC(m_Y, 0, delay[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,22 +48,22 @@
|
||||
#include "../nl_base.h"
|
||||
|
||||
#define TTL_74153(_name, _C0, _C1, _C2, _C3, _A, _B, _G) \
|
||||
NET_REGISTER_DEV(nic74153, _name) \
|
||||
NET_CONNECT(_name, C0, _C0) \
|
||||
NET_CONNECT(_name, C1, _C1) \
|
||||
NET_CONNECT(_name, C2, _C2) \
|
||||
NET_CONNECT(_name, C3, _C3) \
|
||||
NET_CONNECT(_name, A, _A) \
|
||||
NET_CONNECT(_name, B, _B) \
|
||||
NET_CONNECT(_name, G, _G)
|
||||
NET_REGISTER_DEV(nic74153, _name) \
|
||||
NET_CONNECT(_name, C0, _C0) \
|
||||
NET_CONNECT(_name, C1, _C1) \
|
||||
NET_CONNECT(_name, C2, _C2) \
|
||||
NET_CONNECT(_name, C3, _C3) \
|
||||
NET_CONNECT(_name, A, _A) \
|
||||
NET_CONNECT(_name, B, _B) \
|
||||
NET_CONNECT(_name, G, _G)
|
||||
|
||||
NETLIB_DEVICE(nic74153,
|
||||
netlist_ttl_input_t m_C[4];
|
||||
netlist_ttl_input_t m_A;
|
||||
netlist_ttl_input_t m_B;
|
||||
netlist_ttl_input_t m_G;
|
||||
netlist_ttl_input_t m_C[4];
|
||||
netlist_ttl_input_t m_A;
|
||||
netlist_ttl_input_t m_B;
|
||||
netlist_ttl_input_t m_G;
|
||||
|
||||
netlist_ttl_output_t m_Y;
|
||||
netlist_ttl_output_t m_Y;
|
||||
);
|
||||
|
||||
#endif /* NLD_74153_H_ */
|
||||
|
@ -98,7 +98,7 @@ NETLIB_UPDATE(9316)
|
||||
OUTLOGIC(sub.m_RC, sub.m_ent & (sub.m_cnt == 0x0f), NLTIME_FROM_NS(20));
|
||||
}
|
||||
|
||||
inline NETLIB_FUNC_VOID(9316_sub, update_outputs_all, (const UINT8 cnt))
|
||||
NETLIB_FUNC_VOID(9316_sub, update_outputs_all, (const UINT8 cnt))
|
||||
{
|
||||
const netlist_time out_delay = NLTIME_FROM_NS(20);
|
||||
OUTLOGIC(m_QA, (cnt >> 0) & 1, out_delay);
|
||||
@ -107,7 +107,7 @@ inline NETLIB_FUNC_VOID(9316_sub, update_outputs_all, (const UINT8 cnt))
|
||||
OUTLOGIC(m_QD, (cnt >> 3) & 1, out_delay);
|
||||
}
|
||||
|
||||
inline NETLIB_FUNC_VOID(9316_sub, update_outputs, (const UINT8 cnt))
|
||||
NETLIB_FUNC_VOID(9316_sub, update_outputs, (const UINT8 cnt))
|
||||
{
|
||||
const netlist_time out_delay = NLTIME_FROM_NS(20);
|
||||
#if 0
|
||||
|
@ -73,12 +73,18 @@ NETLIB_UPDATE(clock)
|
||||
NETLIB_START(logic_input)
|
||||
{
|
||||
register_output("Q", m_Q);
|
||||
register_param("OUT", m_OUT, 0);
|
||||
}
|
||||
|
||||
NETLIB_UPDATE(logic_input)
|
||||
{
|
||||
}
|
||||
|
||||
NETLIB_UPDATE_PARAM(logic_input)
|
||||
{
|
||||
OUTLOGIC(m_Q, m_OUT.Value() & 1, NLTIME_IMMEDIATE);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
// analog_input
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
@ -81,8 +81,10 @@ NETLIB_DEVICE_WITH_PARAMS(clock,
|
||||
// Special support devices ...
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
NETLIB_DEVICE(logic_input,
|
||||
NETLIB_DEVICE_WITH_PARAMS(logic_input,
|
||||
netlist_ttl_output_t m_Q;
|
||||
|
||||
netlist_param_logic_t m_OUT;
|
||||
);
|
||||
|
||||
NETLIB_DEVICE(analog_input,
|
||||
|
@ -56,6 +56,7 @@ NETLIB_UPDATE(R)
|
||||
|
||||
NETLIB_UPDATE_PARAM(R)
|
||||
{
|
||||
//printf("updating %s to %f\n", name().cstr(), m_R.Value());
|
||||
set_R(m_R.Value());
|
||||
}
|
||||
|
||||
@ -76,6 +77,7 @@ NETLIB_START(POT)
|
||||
|
||||
register_param("R", m_R, 1.0 / NETLIST_GMIN);
|
||||
register_param("DIAL", m_Dial, 0.5);
|
||||
register_param("DIALLOG", m_DialIsLog, 0);
|
||||
|
||||
}
|
||||
|
||||
@ -87,8 +89,11 @@ NETLIB_UPDATE(POT)
|
||||
|
||||
NETLIB_UPDATE_PARAM(POT)
|
||||
{
|
||||
m_R1.set_R(MAX(m_R.Value() * m_Dial.Value(), NETLIST_GMIN));
|
||||
m_R2.set_R(MAX(m_R.Value() * (1.0 - m_Dial.Value()), NETLIST_GMIN));
|
||||
double v = m_Dial.Value();
|
||||
if (m_DialIsLog.Value())
|
||||
v = (exp(v) - 1.0) / (exp(1.0) - 1.0);
|
||||
m_R1.set_R(MAX(m_R.Value() * v, NETLIST_GMIN));
|
||||
m_R2.set_R(MAX(m_R.Value() * (1.0 - v), NETLIST_GMIN));
|
||||
}
|
||||
// ----------------------------------------------------------------------------------------
|
||||
// nld_C
|
||||
|
@ -128,6 +128,7 @@ NETLIB_DEVICE_WITH_PARAMS(POT,
|
||||
|
||||
netlist_param_double_t m_R;
|
||||
netlist_param_double_t m_Dial;
|
||||
netlist_param_logic_t m_DialIsLog;
|
||||
);
|
||||
|
||||
|
||||
@ -345,7 +346,7 @@ public:
|
||||
protected:
|
||||
|
||||
ATTR_COLD virtual void start();
|
||||
ATTR_COLD void update_param();
|
||||
ATTR_HOT void update_param();
|
||||
|
||||
double m_gB; // base conductance / switch on
|
||||
double m_gC; // collector conductance / switch on
|
||||
|
@ -15,45 +15,45 @@ const netlist_time netlist_time::zero = netlist_time::from_raw(0);
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
netlist_queue_t::netlist_queue_t(netlist_base_t &nl)
|
||||
: netlist_timed_queue<netlist_net_t, netlist_time, 512>(), pstate_callback_t(),
|
||||
m_netlist(nl),
|
||||
m_qsize(0)
|
||||
: netlist_timed_queue<netlist_net_t, netlist_time, 512>(), pstate_callback_t(),
|
||||
m_netlist(nl),
|
||||
m_qsize(0)
|
||||
{ }
|
||||
|
||||
void netlist_queue_t::register_state(pstate_manager_t &manager, const pstring &module)
|
||||
{
|
||||
NL_VERBOSE_OUT(("register_state\n"));
|
||||
manager.save_manager(m_qsize, module + "." + "qsize");
|
||||
manager.save_manager(m_times, module + "." + "times");
|
||||
manager.save_manager(&(m_name[0][0]), module + "." + "names", sizeof(m_name));
|
||||
NL_VERBOSE_OUT(("register_state\n"));
|
||||
manager.save_item(m_qsize, module + "." + "qsize");
|
||||
manager.save_item(m_times, module + "." + "times");
|
||||
manager.save_item(&(m_name[0][0]), module + "." + "names", sizeof(m_name));
|
||||
}
|
||||
void netlist_queue_t::on_pre_save()
|
||||
{
|
||||
NL_VERBOSE_OUT(("on_pre_save\n"));
|
||||
m_qsize = this->count();
|
||||
NL_VERBOSE_OUT(("current time %f qsize %d\n", m_netlist->time().as_double(), qsize));
|
||||
for (int i = 0; i < m_qsize; i++ )
|
||||
{
|
||||
m_times[i] = this->listptr()[i].time().as_raw();
|
||||
const char *p = this->listptr()[i].object().name().cstr();
|
||||
int n = MIN(63, strlen(p));
|
||||
strncpy(&(m_name[i][0]), p, n);
|
||||
m_name[i][n] = 0;
|
||||
}
|
||||
NL_VERBOSE_OUT(("on_pre_save\n"));
|
||||
m_qsize = this->count();
|
||||
NL_VERBOSE_OUT(("current time %f qsize %d\n", m_netlist->time().as_double(), qsize));
|
||||
for (int i = 0; i < m_qsize; i++ )
|
||||
{
|
||||
m_times[i] = this->listptr()[i].time().as_raw();
|
||||
const char *p = this->listptr()[i].object().name().cstr();
|
||||
int n = MIN(63, strlen(p));
|
||||
strncpy(&(m_name[i][0]), p, n);
|
||||
m_name[i][n] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void netlist_queue_t::on_post_load()
|
||||
{
|
||||
this->clear();
|
||||
NL_VERBOSE_OUT(("current time %f qsize %d\n", m_netlist->time().as_double(), qsize));
|
||||
for (int i = 0; i < m_qsize; i++ )
|
||||
{
|
||||
netlist_net_t *n = m_netlist.find_net(&(m_name[i][0]));
|
||||
NL_VERBOSE_OUT(("Got %s ==> %p\n", qtemp[i].m_name, n));
|
||||
NL_VERBOSE_OUT(("schedule time %f (%f)\n", n->time().as_double(), qtemp[i].m_time.as_double()));
|
||||
this->push(netlist_queue_t::entry_t(netlist_time::from_raw(m_times[i]), *n));
|
||||
}
|
||||
this->clear();
|
||||
NL_VERBOSE_OUT(("current time %f qsize %d\n", m_netlist->time().as_double(), qsize));
|
||||
for (int i = 0; i < m_qsize; i++ )
|
||||
{
|
||||
netlist_net_t *n = m_netlist.find_net(&(m_name[i][0]));
|
||||
NL_VERBOSE_OUT(("Got %s ==> %p\n", qtemp[i].m_name, n));
|
||||
NL_VERBOSE_OUT(("schedule time %f (%f)\n", n->time().as_double(), qtemp[i].m_time.as_double()));
|
||||
this->push(netlist_queue_t::entry_t(netlist_time::from_raw(m_times[i]), *n));
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
@ -108,13 +108,13 @@ ATTR_COLD void netlist_owned_object_t::init_object(netlist_core_device_t &dev,
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
netlist_base_t::netlist_base_t()
|
||||
: netlist_object_t(NETLIST, GENERIC),
|
||||
m_time_ps(netlist_time::zero),
|
||||
m_queue(*this),
|
||||
m_rem(0),
|
||||
m_div(NETLIST_DIV),
|
||||
m_mainclock(NULL),
|
||||
m_solver(NULL)
|
||||
: netlist_object_t(NETLIST, GENERIC),
|
||||
m_time_ps(netlist_time::zero),
|
||||
m_queue(*this),
|
||||
m_rem(0),
|
||||
m_div(NETLIST_DIV),
|
||||
m_mainclock(NULL),
|
||||
m_solver(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@ -216,12 +216,12 @@ ATTR_HOT ATTR_ALIGN inline void netlist_base_t::update_time(const netlist_time t
|
||||
|
||||
ATTR_HOT ATTR_ALIGN void netlist_base_t::process_queue(INT32 &atime)
|
||||
{
|
||||
if (m_mainclock == NULL)
|
||||
{
|
||||
while ( (atime > 0) && (m_queue.is_not_empty()))
|
||||
{
|
||||
const netlist_queue_t::entry_t &e = m_queue.pop();
|
||||
update_time(e.time(), atime);
|
||||
if (m_mainclock == NULL)
|
||||
{
|
||||
while ( (atime > 0) && (m_queue.is_not_empty()))
|
||||
{
|
||||
const netlist_queue_t::entry_t &e = m_queue.pop();
|
||||
update_time(e.time(), atime);
|
||||
|
||||
//if (FATAL_ERROR_AFTER_NS)
|
||||
// NL_VERBOSE_OUT(("%s\n", e.object().netdev()->name().cstr());
|
||||
@ -254,8 +254,8 @@ ATTR_HOT ATTR_ALIGN void netlist_base_t::process_queue(INT32 &atime)
|
||||
|
||||
NETLIB_NAME(mainclock)::mc_update(mcQ, time() + inc);
|
||||
|
||||
}
|
||||
const netlist_queue_t::entry_t &e = m_queue.pop();
|
||||
}
|
||||
const netlist_queue_t::entry_t &e = m_queue.pop();
|
||||
|
||||
update_time(e.time(), atime);
|
||||
|
||||
|
@ -185,7 +185,7 @@ typedef delegate<void ()> net_update_delegate;
|
||||
//#define NETLIB_CONSTRUCTOR(_chip) ATTR_COLD _chip :: _chip (netlist_setup_t &setup, const char *name)
|
||||
// : net_device_t(setup, name)
|
||||
|
||||
#define NETLIB_UPDATE_PARAM(_chip) ATTR_COLD ATTR_ALIGN void NETLIB_NAME(_chip) :: update_param(void)
|
||||
#define NETLIB_UPDATE_PARAM(_chip) ATTR_HOT ATTR_ALIGN void NETLIB_NAME(_chip) :: update_param(void)
|
||||
#define NETLIB_FUNC_VOID(_chip, _name, _params) ATTR_HOT ATTR_ALIGN void NETLIB_NAME(_chip) :: _name _params
|
||||
|
||||
#define NETLIB_UPDATE_TERMINALS() ATTR_HOT ATTR_ALIGN inline void update_terminals(void)
|
||||
@ -370,8 +370,8 @@ public:
|
||||
protected:
|
||||
ATTR_COLD virtual void save_register()
|
||||
{
|
||||
save(NAME(m_state));
|
||||
netlist_owned_object_t::save_register();
|
||||
save(NAME(m_state));
|
||||
netlist_owned_object_t::save_register();
|
||||
}
|
||||
|
||||
private:
|
||||
@ -462,7 +462,7 @@ private:
|
||||
class netlist_logic_input_t : public netlist_input_t
|
||||
{
|
||||
public:
|
||||
ATTR_COLD netlist_logic_input_t()
|
||||
ATTR_COLD netlist_logic_input_t()
|
||||
: netlist_input_t(INPUT, LOGIC)
|
||||
{
|
||||
// default to TTL
|
||||
@ -487,7 +487,7 @@ public:
|
||||
class netlist_ttl_input_t : public netlist_logic_input_t
|
||||
{
|
||||
public:
|
||||
ATTR_COLD netlist_ttl_input_t()
|
||||
ATTR_COLD netlist_ttl_input_t()
|
||||
: netlist_logic_input_t() { set_thresholds(0.8 , 2.0); }
|
||||
};
|
||||
|
||||
@ -498,7 +498,7 @@ public:
|
||||
class netlist_analog_input_t : public netlist_input_t
|
||||
{
|
||||
public:
|
||||
ATTR_COLD netlist_analog_input_t()
|
||||
ATTR_COLD netlist_analog_input_t()
|
||||
: netlist_input_t(INPUT, ANALOG) { }
|
||||
|
||||
ATTR_HOT inline const double Q_Analog() const;
|
||||
@ -596,23 +596,33 @@ public:
|
||||
hybrid_t m_cur;
|
||||
hybrid_t m_new;
|
||||
|
||||
/* use this to register state.... */
|
||||
ATTR_COLD virtual void late_save_register()
|
||||
{
|
||||
save(NAME(m_last.Analog));
|
||||
save(NAME(m_cur.Analog));
|
||||
save(NAME(m_new.Analog));
|
||||
save(NAME(m_last.Q));
|
||||
save(NAME(m_cur.Q));
|
||||
save(NAME(m_new.Q));
|
||||
save(NAME(m_time));
|
||||
save(NAME(m_active));
|
||||
save(NAME(m_in_queue));
|
||||
netlist_object_t::save_register();
|
||||
}
|
||||
|
||||
protected:
|
||||
UINT32 m_num_cons;
|
||||
|
||||
/* we don't use this to save state
|
||||
* because we may get deleted again ...
|
||||
*/
|
||||
ATTR_COLD virtual void save_register()
|
||||
{
|
||||
save(NAME(m_last.Analog));
|
||||
save(NAME(m_cur.Analog));
|
||||
save(NAME(m_new.Analog));
|
||||
save(NAME(m_last.Q));
|
||||
save(NAME(m_cur.Q));
|
||||
save(NAME(m_new.Q));
|
||||
save(NAME(m_time));
|
||||
save(NAME(m_active));
|
||||
save(NAME(m_in_queue));
|
||||
netlist_object_t::save_register();
|
||||
//assert_always(false, "trying too early to register state in netlist_net_t");
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
ATTR_HOT void update_dev(const netlist_core_terminal_t *inp, const UINT32 mask) const;
|
||||
|
||||
@ -950,23 +960,23 @@ private:
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
class netlist_queue_t : public netlist_timed_queue<netlist_net_t, netlist_time, 512>,
|
||||
public pstate_callback_t
|
||||
public pstate_callback_t
|
||||
{
|
||||
public:
|
||||
|
||||
netlist_queue_t(netlist_base_t &nl);
|
||||
netlist_queue_t(netlist_base_t &nl);
|
||||
|
||||
void register_state(pstate_manager_t &manager, const pstring &module);
|
||||
void on_pre_save();
|
||||
void on_post_load();
|
||||
void register_state(pstate_manager_t &manager, const pstring &module);
|
||||
void on_pre_save();
|
||||
void on_post_load();
|
||||
|
||||
pstate_callback_t &callback() { return *this; }
|
||||
pstate_callback_t &callback() { return *this; }
|
||||
|
||||
private:
|
||||
netlist_base_t &m_netlist;
|
||||
int m_qsize;
|
||||
netlist_time::INTERNALTYPE m_times[512];
|
||||
char m_name[512][64];
|
||||
netlist_base_t &m_netlist;
|
||||
int m_qsize;
|
||||
netlist_time::INTERNALTYPE m_times[512];
|
||||
char m_name[512][64];
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
@ -984,8 +994,8 @@ public:
|
||||
netlist_base_t();
|
||||
virtual ~netlist_base_t();
|
||||
|
||||
ATTR_HOT inline const netlist_queue_t &queue() const { return m_queue; }
|
||||
ATTR_HOT inline netlist_queue_t &queue() { return m_queue; }
|
||||
ATTR_HOT inline const netlist_queue_t &queue() const { return m_queue; }
|
||||
ATTR_HOT inline netlist_queue_t &queue() { return m_queue; }
|
||||
|
||||
ATTR_HOT inline void push_to_queue(netlist_net_t &out, const netlist_time &attime)
|
||||
{
|
||||
@ -1020,14 +1030,14 @@ protected:
|
||||
virtual void vfatalerror(const char *format, va_list ap) const = 0;
|
||||
|
||||
protected:
|
||||
ATTR_COLD virtual void save_register()
|
||||
{
|
||||
save(NAME(m_queue.callback()));
|
||||
save(NAME(m_time_ps));
|
||||
save(NAME(m_rem));
|
||||
save(NAME(m_div));
|
||||
netlist_object_t::save_register();
|
||||
}
|
||||
ATTR_COLD virtual void save_register()
|
||||
{
|
||||
save(NAME(m_queue.callback()));
|
||||
save(NAME(m_time_ps));
|
||||
save(NAME(m_rem));
|
||||
save(NAME(m_div));
|
||||
netlist_object_t::save_register();
|
||||
}
|
||||
|
||||
#if (NL_KEEP_STATISTICS)
|
||||
// performance
|
||||
@ -1039,8 +1049,8 @@ protected:
|
||||
private:
|
||||
ATTR_HOT void update_time(const netlist_time t, INT32 &atime);
|
||||
|
||||
netlist_time m_time_ps;
|
||||
netlist_queue_t m_queue;
|
||||
netlist_time m_time_ps;
|
||||
netlist_queue_t m_queue;
|
||||
UINT32 m_rem;
|
||||
UINT32 m_div;
|
||||
|
||||
@ -1298,19 +1308,19 @@ class netlist_factory
|
||||
{
|
||||
public:
|
||||
|
||||
ATTR_COLD netlist_factory();
|
||||
ATTR_COLD ~netlist_factory();
|
||||
ATTR_COLD netlist_factory();
|
||||
ATTR_COLD ~netlist_factory();
|
||||
|
||||
ATTR_COLD void initialize();
|
||||
ATTR_COLD void initialize();
|
||||
|
||||
template<class _C>
|
||||
ATTR_COLD void register_device(const pstring &name, const pstring &classname)
|
||||
template<class _C>
|
||||
ATTR_COLD void register_device(const pstring &name, const pstring &classname)
|
||||
{
|
||||
m_list.add(new net_device_t_factory< _C >(name, classname) );
|
||||
}
|
||||
|
||||
ATTR_COLD netlist_device_t *new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const;
|
||||
ATTR_COLD netlist_device_t *new_device_by_name(const pstring &name, netlist_setup_t &setup) const;
|
||||
ATTR_COLD netlist_device_t *new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const;
|
||||
ATTR_COLD netlist_device_t *new_device_by_name(const pstring &name, netlist_setup_t &setup) const;
|
||||
|
||||
private:
|
||||
typedef netlist_list_t<net_device_t_base_factory *> list_t;
|
||||
|
@ -47,7 +47,7 @@ typedef UINT8 netlist_sig_t;
|
||||
// DEBUGGING
|
||||
//============================================================
|
||||
|
||||
#define fatalerror xxbreakme
|
||||
//#define fatalerror xxbreakme
|
||||
|
||||
#define NL_VERBOSE (0)
|
||||
#define NL_KEEP_STATISTICS (0)
|
||||
|
@ -209,7 +209,7 @@ public:
|
||||
|
||||
ATTR_COLD entry_t *listptr() { return &m_list[0]; }
|
||||
ATTR_COLD int count() const { return m_end - m_list; }
|
||||
ATTR_HOT inline entry_t & operator[](const int & index) { return m_list[index]; }
|
||||
ATTR_HOT inline entry_t & operator[](const int & index) { return m_list[index]; }
|
||||
|
||||
#if (NL_KEEP_STATISTICS)
|
||||
// profiling
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "nl_util.h"
|
||||
#include "devices/nld_system.h"
|
||||
#include "devices/nld_solver.h"
|
||||
#include "devices/nld_twoterm.h"
|
||||
|
||||
static NETLIST_START(base)
|
||||
NETDEV_TTL_CONST(ttlhigh, 1)
|
||||
@ -521,6 +522,8 @@ void netlist_setup_t::connect(netlist_core_terminal_t &t1, netlist_core_terminal
|
||||
|
||||
void netlist_setup_t::resolve_inputs()
|
||||
{
|
||||
bool has_twoterms = false;
|
||||
|
||||
NL_VERBOSE_OUT(("Resolving ...\n"));
|
||||
for (tagmap_link_t::entry_t *entry = m_links.first(); entry != NULL; entry = m_links.next(entry))
|
||||
{
|
||||
@ -540,7 +543,6 @@ void netlist_setup_t::resolve_inputs()
|
||||
//VERBOSE_OUT(("%s %d\n", out->netdev()->name(), *out->Q_ptr()));
|
||||
}
|
||||
|
||||
#if 0
|
||||
NL_VERBOSE_OUT(("deleting empty nets ...\n"));
|
||||
|
||||
// delete empty nets ...
|
||||
@ -556,10 +558,44 @@ void netlist_setup_t::resolve_inputs()
|
||||
pn--;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (m_netlist.solver() != NULL)
|
||||
m_netlist.solver()->post_start();
|
||||
|
||||
/* now that nets were deleted ... register all net items */
|
||||
NL_VERBOSE_OUT(("late state saving for nets ...\n"));
|
||||
|
||||
for (netlist_net_t::list_t::entry_t *pn = netlist().m_nets.first(); pn != NULL; pn = netlist().m_nets.next(pn))
|
||||
pn->object()->late_save_register();
|
||||
|
||||
NL_VERBOSE_OUT(("looking for terminals not connected ...\n"));
|
||||
for (tagmap_terminal_t::entry_t *entry = m_terminals.first(); entry != NULL; entry = m_terminals.next(entry))
|
||||
{
|
||||
if (!entry->object()->has_net())
|
||||
netlist().xfatalerror("Found terminal %s without a net\n",
|
||||
entry->object()->name().cstr());
|
||||
}
|
||||
|
||||
|
||||
NL_VERBOSE_OUT(("looking for two terms connected to rail nets ...\n"));
|
||||
for (tagmap_devices_t::entry_t *entry = netlist().m_devices.first(); entry != NULL; entry = netlist().m_devices.next(entry))
|
||||
{
|
||||
NETLIB_NAME(twoterm) *t = dynamic_cast<NETLIB_NAME(twoterm) *>(entry->object());
|
||||
if (t != NULL)
|
||||
{
|
||||
has_twoterms = true;
|
||||
if (t->m_N.net().isRailNet() && t->m_P.net().isRailNet())
|
||||
netlist().xfatalerror("Found device %s connected only to railterminals %s/%s\n",
|
||||
t->name().cstr(), t->m_N.net().name().cstr(), t->m_P.net().name().cstr());
|
||||
}
|
||||
}
|
||||
|
||||
NL_VERBOSE_OUT(("initialize solver ...\n"));
|
||||
|
||||
if (m_netlist.solver() == NULL)
|
||||
{
|
||||
if (!has_twoterms)
|
||||
netlist().xfatalerror("No solver found for this net although analog elements are present\n");
|
||||
}
|
||||
else
|
||||
m_netlist.solver()->post_start();
|
||||
|
||||
}
|
||||
|
||||
@ -581,17 +617,27 @@ void netlist_setup_t::start_devices()
|
||||
|
||||
|
||||
NL_VERBOSE_OUT(("Searching for mainclock and solver ...\n"));
|
||||
/* find the main clock ... */
|
||||
|
||||
/* find the main clock and solver ... */
|
||||
bool has_mainclock = false;
|
||||
bool has_solver = false;
|
||||
|
||||
for (tagmap_devices_t::entry_t *entry = netlist().m_devices.first(); entry != NULL; entry = netlist().m_devices.next(entry))
|
||||
{
|
||||
netlist_device_t *dev = entry->object();
|
||||
if (dynamic_cast<NETLIB_NAME(mainclock)*>(dev) != NULL)
|
||||
{
|
||||
if (has_mainclock)
|
||||
m_netlist.xfatalerror("Found more than one mainclock");
|
||||
m_netlist.set_mainclock_dev(dynamic_cast<NETLIB_NAME(mainclock)*>(dev));
|
||||
has_mainclock = true;
|
||||
}
|
||||
if (dynamic_cast<NETLIB_NAME(solver)*>(dev) != NULL)
|
||||
{
|
||||
if (has_solver)
|
||||
m_netlist.xfatalerror("Found more than one solver");
|
||||
m_netlist.set_solver_dev(dynamic_cast<NETLIB_NAME(solver)*>(dev));
|
||||
has_solver = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,12 +32,12 @@ ATTR_COLD void pstate_manager_t::save_state_ptr(const pstring &stname, const pst
|
||||
|
||||
ATTR_COLD void pstate_manager_t::pre_save()
|
||||
{
|
||||
for (int i=0; i < m_callback.count(); i++)
|
||||
m_callback[i]->on_pre_save();
|
||||
for (int i=0; i < m_callback.count(); i++)
|
||||
m_callback[i]->on_pre_save();
|
||||
}
|
||||
|
||||
ATTR_COLD void pstate_manager_t::post_load()
|
||||
{
|
||||
for (int i=0; i < m_callback.count(); i++)
|
||||
m_callback[i]->on_post_load();
|
||||
for (int i=0; i < m_callback.count(); i++)
|
||||
m_callback[i]->on_post_load();
|
||||
}
|
||||
|
@ -16,22 +16,22 @@
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
#define PSTATE_INTERFACE_DECL() \
|
||||
template<typename C> ATTR_COLD void save(C &state, const pstring &stname);
|
||||
template<typename C> ATTR_COLD void save(C &state, const pstring &stname);
|
||||
|
||||
#define PSTATE_INTERFACE(obj, manager, module) \
|
||||
template<typename C> ATTR_COLD void obj::save(C &state, const pstring &stname) \
|
||||
{ \
|
||||
manager->save_manager(state, module + "." + stname); \
|
||||
}
|
||||
template<typename C> ATTR_COLD void obj::save(C &state, const pstring &stname) \
|
||||
{ \
|
||||
manager->save_item(state, module + "." + stname); \
|
||||
}
|
||||
|
||||
enum pstate_data_type_e {
|
||||
NOT_SUPPORTED,
|
||||
DT_CUSTOM,
|
||||
DT_DOUBLE,
|
||||
DT_INT64,
|
||||
DT_INT8,
|
||||
DT_INT,
|
||||
DT_BOOLEAN
|
||||
NOT_SUPPORTED,
|
||||
DT_CUSTOM,
|
||||
DT_DOUBLE,
|
||||
DT_INT64,
|
||||
DT_INT8,
|
||||
DT_INT,
|
||||
DT_BOOLEAN
|
||||
};
|
||||
|
||||
template<typename _ItemType> struct nl_datatype { static const pstate_data_type_e type = pstate_data_type_e(NOT_SUPPORTED); };
|
||||
@ -54,13 +54,13 @@ struct pstate_entry_t
|
||||
{
|
||||
typedef netlist_list_t<pstate_entry_t *> list_t;
|
||||
|
||||
pstate_entry_t(const pstring &stname, const pstate_data_type_e dt, const int size, const int count, void *ptr) :
|
||||
m_name(stname), m_dt(dt), m_size(size), m_count(count), m_ptr(ptr) { }
|
||||
pstring m_name;
|
||||
pstate_data_type_e m_dt;
|
||||
int m_size;
|
||||
int m_count;
|
||||
void *m_ptr;
|
||||
pstate_entry_t(const pstring &stname, const pstate_data_type_e dt, const int size, const int count, void *ptr) :
|
||||
m_name(stname), m_dt(dt), m_size(size), m_count(count), m_ptr(ptr) { }
|
||||
pstring m_name;
|
||||
pstate_data_type_e m_dt;
|
||||
int m_size;
|
||||
int m_count;
|
||||
void *m_ptr;
|
||||
};
|
||||
|
||||
class pstate_manager_t;
|
||||
@ -68,13 +68,13 @@ class pstate_manager_t;
|
||||
class pstate_callback_t
|
||||
{
|
||||
public:
|
||||
typedef netlist_list_t<pstate_callback_t *> list_t;
|
||||
typedef netlist_list_t<pstate_callback_t *> list_t;
|
||||
|
||||
virtual ~pstate_callback_t() { };
|
||||
virtual ~pstate_callback_t() { };
|
||||
|
||||
virtual void register_state(pstate_manager_t &manager, const pstring &module) = 0;
|
||||
virtual void on_pre_save() = 0;
|
||||
virtual void on_post_load() = 0;
|
||||
virtual void register_state(pstate_manager_t &manager, const pstring &module) = 0;
|
||||
virtual void on_pre_save() = 0;
|
||||
virtual void on_post_load() = 0;
|
||||
protected:
|
||||
};
|
||||
|
||||
@ -84,42 +84,42 @@ public:
|
||||
|
||||
ATTR_COLD ~pstate_manager_t();
|
||||
|
||||
template<typename C> ATTR_COLD void save_manager(C &state, const pstring &stname)
|
||||
{
|
||||
save_state_ptr(stname, nl_datatype<C>::type, sizeof(C), 1, &state);
|
||||
}
|
||||
template<typename C> ATTR_COLD void save_item(C &state, const pstring &stname)
|
||||
{
|
||||
save_state_ptr(stname, nl_datatype<C>::type, sizeof(C), 1, &state);
|
||||
}
|
||||
|
||||
template<typename C, std::size_t N> ATTR_COLD void save_manager(C (&state)[N], const pstring &stname)
|
||||
{
|
||||
save_state_ptr(stname, nl_datatype<C>::type, sizeof(state[0]), N, &(state[0]));
|
||||
}
|
||||
template<typename C, std::size_t N> ATTR_COLD void save_item(C (&state)[N], const pstring &stname)
|
||||
{
|
||||
save_state_ptr(stname, nl_datatype<C>::type, sizeof(state[0]), N, &(state[0]));
|
||||
}
|
||||
|
||||
template<typename C> ATTR_COLD void save_manager(C *state, const pstring &stname, const int count)
|
||||
{
|
||||
save_state_ptr(stname, nl_datatype<C>::type, sizeof(C), count, state);
|
||||
}
|
||||
template<typename C> ATTR_COLD void save_item(C *state, const pstring &stname, const int count)
|
||||
{
|
||||
save_state_ptr(stname, nl_datatype<C>::type, sizeof(C), count, state);
|
||||
}
|
||||
|
||||
ATTR_COLD void pre_save();
|
||||
ATTR_COLD void post_load();
|
||||
ATTR_COLD void pre_save();
|
||||
ATTR_COLD void post_load();
|
||||
|
||||
inline const pstate_entry_t::list_t &save_list() const { return m_save; }
|
||||
|
||||
protected:
|
||||
ATTR_COLD void save_state_ptr(const pstring &stname, const pstate_data_type_e, const int size, const int count, void *ptr);
|
||||
ATTR_COLD void save_state_ptr(const pstring &stname, const pstate_data_type_e, const int size, const int count, void *ptr);
|
||||
|
||||
private:
|
||||
pstate_entry_t::list_t m_save;
|
||||
pstate_callback_t::list_t m_callback;
|
||||
};
|
||||
|
||||
template<> ATTR_COLD inline void pstate_manager_t::save_manager(pstate_callback_t &state, const pstring &stname)
|
||||
template<> ATTR_COLD inline void pstate_manager_t::save_item(pstate_callback_t &state, const pstring &stname)
|
||||
{
|
||||
//save_state_ptr(stname, DT_CUSTOM, 0, 1, &state);
|
||||
m_callback.add(&state);
|
||||
state.register_state(*this, stname);
|
||||
//save_state_ptr(stname, DT_CUSTOM, 0, 1, &state);
|
||||
m_callback.add(&state);
|
||||
state.register_state(*this, stname);
|
||||
}
|
||||
|
||||
template<> ATTR_COLD inline void pstate_manager_t::save_manager(netlist_time &nlt, const pstring &stname)
|
||||
template<> ATTR_COLD inline void pstate_manager_t::save_item(netlist_time &nlt, const pstring &stname)
|
||||
{
|
||||
save_state_ptr(stname, DT_INT64, sizeof(netlist_time::INTERNALTYPE), 1, nlt.get_internaltype_ptr());
|
||||
}
|
||||
|
@ -24,12 +24,12 @@ pstring::str_t *pstring::m_zero = NULL;
|
||||
//#define DEBUG_MODE (0)
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
#ifndef IMMEDIATE_MODE
|
||||
#define IMMEDIATE_MODE (1)
|
||||
#endif
|
||||
#ifndef DEBUG_MODE
|
||||
#define DEBUG_MODE (0)
|
||||
#endif
|
||||
#ifndef IMMEDIATE_MODE
|
||||
#define IMMEDIATE_MODE (1)
|
||||
#endif
|
||||
#ifndef DEBUG_MODE
|
||||
#define DEBUG_MODE (0)
|
||||
#endif
|
||||
#else
|
||||
#ifndef IMMEDIATE_MODE
|
||||
#define IMMEDIATE_MODE (1)
|
||||
|
@ -370,6 +370,7 @@ static NETLIST_START(pong_schematics)
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
NETDEV_POT(ic_b9_POT, RES_K(1)) // This is a guess!!
|
||||
NETDEV_PARAM(ic_b9_POT.DIALLOG, 1) // Log Dial ...
|
||||
NETDEV_R(ic_b9_RPRE, 470)
|
||||
|
||||
NET_C(ic_b9_POT.1, V5)
|
||||
@ -377,7 +378,7 @@ static NETLIST_START(pong_schematics)
|
||||
NET_C(ic_b9_POT.2, ic_b9_RPRE.1)
|
||||
NET_C(ic_b9_RPRE.2, ic_b9.CONT)
|
||||
|
||||
NETDEV_R(ic_b9_R, RES_K(71))
|
||||
NETDEV_R(ic_b9_R, RES_K(81)) // Adjustment pot
|
||||
NETDEV_C(ic_b9_C, CAP_U(.1))
|
||||
NETDEV_D(ic_b9_D, 1N914)
|
||||
NETDEV_NE555(ic_b9)
|
||||
@ -409,6 +410,7 @@ static NETLIST_START(pong_schematics)
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
||||
NETDEV_POT(ic_a9_POT, RES_K(1)) // This is a guess!!
|
||||
NETDEV_PARAM(ic_a9_POT.DIALLOG, 1) // Log Dial ...
|
||||
NETDEV_R(ic_a9_RPRE, 470)
|
||||
|
||||
NET_C(ic_a9_POT.1, V5)
|
||||
@ -416,7 +418,7 @@ static NETLIST_START(pong_schematics)
|
||||
NET_C(ic_a9_POT.2, ic_a9_RPRE.1)
|
||||
NET_C(ic_a9_RPRE.2, ic_a9.CONT)
|
||||
|
||||
NETDEV_R(ic_a9_R, RES_K(71))
|
||||
NETDEV_R(ic_a9_R, RES_K(81)) // Adjustment pot
|
||||
NETDEV_C(ic_a9_C, CAP_U(.1))
|
||||
NETDEV_D(ic_a9_D, 1N914)
|
||||
NETDEV_NE555(ic_a9)
|
||||
@ -792,29 +794,19 @@ public:
|
||||
m_video(*this, "fixfreq"),
|
||||
|
||||
m_dac(*this, "dac"), /* just to have a sound device */
|
||||
m_srst(*this, "maincpu", "SRST"),
|
||||
m_p_P0(*this, "maincpu", "ic_b9_POT.DIAL"),
|
||||
m_p_P1(*this, "maincpu", "ic_a9_POT.DIAL"),
|
||||
m_sw1a(*this, "maincpu", "sw1a.POS"),
|
||||
m_sw1b(*this, "maincpu", "sw1b.POS"),
|
||||
m_p_R0(*this, "maincpu", "ic_a9_R.R"),
|
||||
m_p_R1(*this, "maincpu", "ic_b9_R.R")
|
||||
m_sw1a(*this, "maincpu:sw1a"),
|
||||
m_sw1b(*this, "maincpu:sw1b")
|
||||
{
|
||||
}
|
||||
|
||||
// devices
|
||||
required_device<netlist_mame_device> m_maincpu;
|
||||
required_device<netlist_mame_device_t> m_maincpu;
|
||||
required_device<fixedfreq_device> m_video;
|
||||
required_device<dac_device> m_dac; /* just to have a sound device */
|
||||
|
||||
// sub devices
|
||||
netlist_mame_device::required_output<netlist_logic_output_t> m_srst;
|
||||
netlist_mame_device::required_param<netlist_param_double_t> m_p_P0;
|
||||
netlist_mame_device::required_param<netlist_param_double_t> m_p_P1;
|
||||
netlist_mame_device::required_param<netlist_param_int_t> m_sw1a;
|
||||
netlist_mame_device::required_param<netlist_param_int_t> m_sw1b;
|
||||
netlist_mame_device::required_param<netlist_param_double_t> m_p_R0;
|
||||
netlist_mame_device::required_param<netlist_param_double_t> m_p_R1;
|
||||
required_device<netlist_mame_logic_input_t> m_sw1a;
|
||||
required_device<netlist_mame_logic_input_t> m_sw1b;
|
||||
|
||||
UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
|
||||
|
||||
@ -827,12 +819,6 @@ public:
|
||||
m_dac->write_unsigned8(64*data);
|
||||
}
|
||||
|
||||
NETDEV_ANALOG_CALLBACK_MEMBER(video_cb)
|
||||
{
|
||||
m_video->update_vid(data, time);
|
||||
//printf("%20.15f\n", newval);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
// driver_device overrides
|
||||
@ -851,7 +837,7 @@ static NETLIST_START(pong)
|
||||
NETLIST_MEMREGION("maincpu")
|
||||
|
||||
NETDEV_ANALOG_CALLBACK(sound_cb, sound, pong_state, sound_cb, "")
|
||||
NETDEV_ANALOG_CALLBACK(video_cb, videomix, pong_state, video_cb, "")
|
||||
NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
|
||||
NETLIST_END
|
||||
|
||||
static NETLIST_START(pong_fast)
|
||||
@ -859,7 +845,7 @@ static NETLIST_START(pong_fast)
|
||||
NETLIST_INCLUDE(pong_schematics)
|
||||
|
||||
NETDEV_ANALOG_CALLBACK(sound_cb, sound, pong_state, sound_cb, "")
|
||||
NETDEV_ANALOG_CALLBACK(video_cb, videomix, pong_state, video_cb, "")
|
||||
NETDEV_ANALOG_CALLBACK(video_cb, videomix, fixedfreq_device, update_vid, "fixfreq")
|
||||
|
||||
NETLIST_END
|
||||
|
||||
@ -879,63 +865,34 @@ void pong_state::video_start()
|
||||
|
||||
INPUT_CHANGED_MEMBER(pong_state::input_changed)
|
||||
{
|
||||
double pad;
|
||||
int numpad = (FPTR) (param);
|
||||
|
||||
switch (numpad)
|
||||
{
|
||||
case IC_PADDLE1:
|
||||
case IC_PADDLE2:
|
||||
{
|
||||
// http://ion.chem.usu.edu/~sbialkow/Classes/564/Thevenin/Thevenin.html
|
||||
|
||||
double fac = (double) newval / (double) 256;
|
||||
fac = (exp(fac) - 1.0) / (exp(1.0) -1.0) ;
|
||||
switch (numpad)
|
||||
{
|
||||
case IC_PADDLE1: m_p_P0->setTo(fac); break;
|
||||
case IC_PADDLE2: m_p_P1->setTo(fac); break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case IC_SWITCH:
|
||||
m_sw1a->setTo(newval ? 1 : 0);
|
||||
m_sw1b->setTo(newval ? 1 : 0);
|
||||
break;
|
||||
case IC_COIN:
|
||||
m_srst->set_Q(newval & 1, NLTIME_FROM_US(500));
|
||||
break;
|
||||
case IC_VR1:
|
||||
case IC_VR2:
|
||||
pad = (double) newval / (double) 100 * RES_K(50) + RES_K(56);
|
||||
switch (numpad)
|
||||
{
|
||||
case IC_VR1: m_p_R0->setTo(pad); break;
|
||||
case IC_VR2: m_p_R1->setTo(pad); break;
|
||||
}
|
||||
m_sw1a->write(newval ? 1 : 0);
|
||||
m_sw1b->write(newval ? 1 : 0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START( pong )
|
||||
PORT_START( "PADDLE0" ) /* fake input port for player 1 paddle */
|
||||
PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_CHANGED_MEMBER(DEVICE_SELF, pong_state, input_changed,IC_PADDLE1)
|
||||
PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot0")
|
||||
|
||||
PORT_START( "PADDLE1" ) /* fake input port for player 2 paddle */
|
||||
PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(2) PORT_CHANGED_MEMBER(DEVICE_SELF, pong_state, input_changed, IC_PADDLE2)
|
||||
PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(2) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot1")
|
||||
|
||||
PORT_START("IN0") /* fake as well */
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, pong_state, input_changed, IC_COIN)
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) NETLIST_LOGIC_PORT_CHANGED("maincpu", "srst")
|
||||
PORT_DIPNAME( 0x06, 0x00, "Game Won" ) PORT_DIPLOCATION("SW1A:1,SW1B:1") PORT_CHANGED_MEMBER(DEVICE_SELF, pong_state, input_changed, IC_SWITCH)
|
||||
PORT_DIPSETTING( 0x00, "11" )
|
||||
PORT_DIPSETTING( 0x06, "15" )
|
||||
|
||||
PORT_START("VR1")
|
||||
PORT_ADJUSTER( 50, "VR1 - 50k, Paddle 1 adjustment" ) PORT_CHANGED_MEMBER(DEVICE_SELF, pong_state, input_changed, IC_VR1)
|
||||
PORT_ADJUSTER( 50, "VR1 - 50k, Paddle 1 adjustment" ) NETLIST_ANALOG_PORT_CHANGED("maincpu", "vr0")
|
||||
PORT_START("VR2")
|
||||
PORT_ADJUSTER( 50, "VR2 - 50k, Paddle 2 adjustment" ) PORT_CHANGED_MEMBER(DEVICE_SELF, pong_state, input_changed, IC_VR2)
|
||||
PORT_ADJUSTER( 50, "VR2 - 50k, Paddle 2 adjustment" ) NETLIST_ANALOG_PORT_CHANGED("maincpu", "vr1")
|
||||
//PORT_START("GATESPEED")
|
||||
//PORT_ADJUSTER( 100, "Logic Gate Delay" ) PORT_MINMAX(10, 200) PORT_CHANGED_MEMBER(DEVICE_SELF, pong_state, input_changed, IC_GATEDELAY)
|
||||
|
||||
@ -945,6 +902,15 @@ static MACHINE_CONFIG_START( pong, pong_state )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_NETLIST_ADD("maincpu", pong)
|
||||
MCFG_NETLIST_ANALOG_INPUT("maincpu", "vr0", "ic_b9_R.R")
|
||||
MCFG_NETLIST_ANALOG_INPUT_MULT_OFFSET(1.0 / 100.0 * RES_K(50), RES_K(56) )
|
||||
MCFG_NETLIST_ANALOG_INPUT("maincpu", "vr1", "ic_a9_R.R")
|
||||
MCFG_NETLIST_ANALOG_INPUT_MULT_OFFSET(1.0 / 100.0 * RES_K(50), RES_K(56) )
|
||||
MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot0", "ic_b9_POT.DIAL")
|
||||
MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot1", "ic_a9_POT.DIAL")
|
||||
MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1a", "sw1a.POS", 0, 0x01)
|
||||
MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1b", "sw1b.POS", 0, 0x01)
|
||||
MCFG_NETLIST_LOGIC_INPUT("maincpu", "srst", "SRST.OUT", 0, 0x01)
|
||||
|
||||
/* video hardware */
|
||||
|
||||
@ -962,7 +928,8 @@ MACHINE_CONFIG_END
|
||||
static MACHINE_CONFIG_DERIVED( pongf, pong )
|
||||
|
||||
/* basic machine hardware */
|
||||
MCFG_NETLIST_REPLACE("maincpu", pong_fast)
|
||||
MCFG_DEVICE_MODIFY("maincpu")
|
||||
MCFG_NETLIST_SETUP(pong_fast)
|
||||
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
@ -110,13 +110,13 @@ public:
|
||||
|
||||
virtual ~netlist_tool_t() { };
|
||||
|
||||
void read_netlist(const char *buffer)
|
||||
{
|
||||
m_setup = new netlist_setup_t(*this);
|
||||
this->set_clock_freq(NETLIST_CLOCK);
|
||||
void read_netlist(const char *buffer)
|
||||
{
|
||||
m_setup = new netlist_setup_t(*this);
|
||||
this->init_object(*this, "netlist");
|
||||
m_setup->init();
|
||||
|
||||
// register additional devices
|
||||
//m_setup->factory().register_device<nld_analog_callback>( "NETDEV_CALLBACK", "nld_analog_callback");
|
||||
this->set_clock_freq(NETLIST_CLOCK);
|
||||
|
||||
// read the netlist ...
|
||||
//m_setup_func(*m_setup);
|
||||
|
Loading…
Reference in New Issue
Block a user