mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
Netlist: logs now write to individual log files
This commit is contained in:
parent
7069a5828c
commit
b7d1e61757
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -2140,6 +2140,8 @@ src/emu/netlist/devices/nld_7486.c svneol=native#text/plain
|
|||||||
src/emu/netlist/devices/nld_7486.h svneol=native#text/plain
|
src/emu/netlist/devices/nld_7486.h svneol=native#text/plain
|
||||||
src/emu/netlist/devices/nld_NE555.c svneol=native#text/plain
|
src/emu/netlist/devices/nld_NE555.c svneol=native#text/plain
|
||||||
src/emu/netlist/devices/nld_NE555.h svneol=native#text/plain
|
src/emu/netlist/devices/nld_NE555.h svneol=native#text/plain
|
||||||
|
src/emu/netlist/devices/nld_log.c svneol=native#text/plain
|
||||||
|
src/emu/netlist/devices/nld_log.h svneol=native#text/plain
|
||||||
src/emu/netlist/devices/nld_signal.h svneol=native#text/plain
|
src/emu/netlist/devices/nld_signal.h svneol=native#text/plain
|
||||||
src/emu/netlist/devices/nld_system.c svneol=native#text/plain
|
src/emu/netlist/devices/nld_system.c svneol=native#text/plain
|
||||||
src/emu/netlist/devices/nld_system.h svneol=native#text/plain
|
src/emu/netlist/devices/nld_system.h svneol=native#text/plain
|
||||||
|
@ -68,17 +68,6 @@ NETLIB_UPDATE(analog_input)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
NETLIB_START(log)
|
|
||||||
{
|
|
||||||
register_input("I", m_I);
|
|
||||||
}
|
|
||||||
|
|
||||||
NETLIB_UPDATE(log)
|
|
||||||
{
|
|
||||||
printf("%s: %f %f\n", name().cstr(), netlist().time().as_double(), INPANALOG(m_I));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
NETLIB_START(nicMultiSwitch)
|
NETLIB_START(nicMultiSwitch)
|
||||||
{
|
{
|
||||||
static const char *sIN[8] = { "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8" };
|
static const char *sIN[8] = { "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8" };
|
||||||
|
@ -68,6 +68,8 @@
|
|||||||
|
|
||||||
#include "nld_NE555.h"
|
#include "nld_NE555.h"
|
||||||
|
|
||||||
|
#include "nld_log.h"
|
||||||
|
|
||||||
// this is a bad hack
|
// this is a bad hack
|
||||||
#define USE_OLD7493 (0)
|
#define USE_OLD7493 (0)
|
||||||
|
|
||||||
@ -95,9 +97,6 @@
|
|||||||
NET_CONNECT(_name, S, _S) \
|
NET_CONNECT(_name, S, _S) \
|
||||||
NET_CONNECT(_name, R, _R)
|
NET_CONNECT(_name, R, _R)
|
||||||
|
|
||||||
#define NETDEV_LOG(_name, _I) \
|
|
||||||
NET_REGISTER_DEV(log, _name) \
|
|
||||||
NET_CONNECT(_name, I, _I)
|
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------
|
||||||
@ -203,11 +202,6 @@ NETLIB_DEVICE(analog_input,
|
|||||||
netlist_analog_output_t m_Q;
|
netlist_analog_output_t m_Q;
|
||||||
);
|
);
|
||||||
|
|
||||||
NETLIB_DEVICE(log,
|
|
||||||
netlist_analog_input_t m_I;
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------
|
||||||
// Special devices ...
|
// Special devices ...
|
||||||
// ----------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------
|
||||||
|
24
src/emu/netlist/devices/nld_log.c
Normal file
24
src/emu/netlist/devices/nld_log.c
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* nld_log.c
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "nld_log.h"
|
||||||
|
|
||||||
|
NETLIB_START(log)
|
||||||
|
{
|
||||||
|
register_input("I", m_I);
|
||||||
|
|
||||||
|
pstring filename = "netlist_" + name() + ".log";
|
||||||
|
m_file = fopen(filename, "w");
|
||||||
|
}
|
||||||
|
|
||||||
|
NETLIB_UPDATE(log)
|
||||||
|
{
|
||||||
|
fprintf(m_file, "%e %e\n", netlist().time().as_double(), INPANALOG(m_I));
|
||||||
|
}
|
||||||
|
|
||||||
|
NETLIB_NAME(log)::~NETLIB_NAME(log)()
|
||||||
|
{
|
||||||
|
fclose(m_file);
|
||||||
|
}
|
34
src/emu/netlist/devices/nld_log.h
Normal file
34
src/emu/netlist/devices/nld_log.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// license:GPL-2.0+
|
||||||
|
// copyright-holders:Couriersud
|
||||||
|
/*
|
||||||
|
* nld_log.h
|
||||||
|
*
|
||||||
|
* Devices supporting analysis and logging
|
||||||
|
*
|
||||||
|
* nld_log:
|
||||||
|
*
|
||||||
|
* +---------+
|
||||||
|
* | ++ |
|
||||||
|
* I | | ==> Log to file "netlist_" + name() + ".log"
|
||||||
|
* | |
|
||||||
|
* +---------+
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NLD_LOG_H_
|
||||||
|
#define NLD_LOG_H_
|
||||||
|
|
||||||
|
#include "../nl_base.h"
|
||||||
|
|
||||||
|
#define NETDEV_LOG(_name, _I) \
|
||||||
|
NET_REGISTER_DEV(log, _name) \
|
||||||
|
NET_CONNECT(_name, I, _I)
|
||||||
|
|
||||||
|
NETLIB_DEVICE(log,
|
||||||
|
~NETLIB_NAME(log)();
|
||||||
|
netlist_analog_input_t m_I;
|
||||||
|
private:
|
||||||
|
FILE *m_file;
|
||||||
|
);
|
||||||
|
|
||||||
|
#endif /* NLD_LOG_H_ */
|
@ -29,4 +29,5 @@ NETLISTOBJS+= \
|
|||||||
$(NETLISTOBJ)/devices/nld_7474.o \
|
$(NETLISTOBJ)/devices/nld_7474.o \
|
||||||
$(NETLISTOBJ)/devices/nld_7486.o \
|
$(NETLISTOBJ)/devices/nld_7486.o \
|
||||||
$(NETLISTOBJ)/devices/nld_NE555.o \
|
$(NETLISTOBJ)/devices/nld_NE555.o \
|
||||||
|
$(NETLISTOBJ)/devices/nld_log.o \
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user