summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/netlist.cpp
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2020-07-05 15:49:59 +0200
committer couriersud <couriersud@gmx.org>2020-07-05 15:49:59 +0200
commite339a280f4292aa3dc74baffb0c8a22018a14711 (patch)
treef0b33f8fe51a18ab96d213d166af7b66acbf4ebc /src/devices/machine/netlist.cpp
parent9e86f5e86612c4f61b27e5ada86ac9bdebcbc272 (diff)
netlist: remove soft reset support.
* Electronic circuits and base components like resistors or capacitors do not have a reset line. You can use them to create reset circuits. There is thus no point to support soft reset, the equivalent to pressing the reset button. * Fixed some bugs around reset and start up logic. * This also fixes the "scramble F3" crash.
Diffstat (limited to 'src/devices/machine/netlist.cpp')
-rw-r--r--src/devices/machine/netlist.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/devices/machine/netlist.cpp b/src/devices/machine/netlist.cpp
index cf839c876ea..757d084c415 100644
--- a/src/devices/machine/netlist.cpp
+++ b/src/devices/machine/netlist.cpp
@@ -824,8 +824,10 @@ void netlist_mame_stream_output_device::device_start()
void netlist_mame_stream_output_device::device_reset()
{
LOGDEVCALLS("reset %s\n", name());
+#if 0
m_cur = 0.0;
m_last_buffer_time = netlist::netlist_time_ext::zero();
+#endif
}
void netlist_mame_stream_output_device::sound_update_fill(std::size_t samples, stream_sample_t *target)
@@ -906,6 +908,7 @@ netlist_mame_device::netlist_mame_device(const machine_config &mconfig, device_t
, m_attotime_per_clock(attotime::zero)
, m_old(netlist::netlist_time_ext::zero())
, m_setup_func(nullptr)
+ , m_device_reset_called(false)
{
}
@@ -1045,6 +1048,10 @@ void netlist_mame_device::device_start()
m_old = netlist::netlist_time_ext::zero();
m_rem = netlist::netlist_time_ext::zero();
+ m_cur_time = attotime::zero;
+
+ m_device_reset_called = false;
+
LOGDEVCALLS("device_start exit\n");
}
@@ -1061,10 +1068,17 @@ void netlist_mame_device::device_clock_changed()
void netlist_mame_device::device_reset()
{
LOGDEVCALLS("device_reset\n");
- m_cur_time = attotime::zero;
- m_old = netlist::netlist_time_ext::zero();
- m_rem = netlist::netlist_time_ext::zero();
- netlist().exec().reset();
+ if (!m_device_reset_called)
+ {
+ // netlists don't have a reset line, doing a soft-reset is pointless
+ // the only reason we call these here once after device_start
+ // is that netlist input devices may be started after the netlist device
+ // and because the startup code may trigger actions which need all
+ // devices set up.
+ netlist().free_setup_resources();
+ netlist().exec().reset();
+ m_device_reset_called = true;
+ }
}
void netlist_mame_device::device_stop()