summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/7474.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/7474.cpp')
-rw-r--r--src/devices/machine/7474.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/devices/machine/7474.cpp b/src/devices/machine/7474.cpp
index ae2a90e8f61..45e21406edc 100644
--- a/src/devices/machine/7474.cpp
+++ b/src/devices/machine/7474.cpp
@@ -55,14 +55,15 @@ DEFINE_DEVICE_TYPE(TTL7474, ttl7474_device, "7474", "7474 TTL")
// ttl7474_device - constructor
//-------------------------------------------------
-ttl7474_device::ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, TTL7474, tag, owner, clock),
- m_output_func(*this),
- m_comp_output_func(*this)
+ttl7474_device::ttl7474_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, TTL7474, tag, owner, clock),
+ m_output_func(*this),
+ m_comp_output_func(*this)
{
init();
}
+
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@@ -78,9 +79,6 @@ void ttl7474_device::device_start()
save_item(NAME(m_last_clock));
save_item(NAME(m_last_output));
save_item(NAME(m_last_output_comp));
-
- m_output_func.resolve_safe();
- m_comp_output_func.resolve_safe();
}
@@ -90,6 +88,7 @@ void ttl7474_device::device_start()
void ttl7474_device::device_reset()
{
+ // FIXME: remove this - many flipflops aren't connected to system reset
init();
}
@@ -128,13 +127,13 @@ void ttl7474_device::update()
if (m_output != m_last_output)
{
m_last_output = m_output;
- m_output_func(m_output!=0);
+ m_output_func(m_output != 0);
}
// call callback if any of the outputs changed
if (m_output_comp != m_last_output_comp)
{
m_last_output_comp = m_output_comp;
- m_comp_output_func(m_output_comp!=0);
+ m_comp_output_func(m_output_comp != 0);
}
}
@@ -143,7 +142,7 @@ void ttl7474_device::update()
// clear_w - set the clear line state
//-------------------------------------------------
-WRITE_LINE_MEMBER( ttl7474_device::clear_w )
+void ttl7474_device::clear_w(int state)
{
m_clear = state & 1;
update();
@@ -154,7 +153,7 @@ WRITE_LINE_MEMBER( ttl7474_device::clear_w )
// clear_w - set the clear line state
//-------------------------------------------------
-WRITE_LINE_MEMBER( ttl7474_device::preset_w )
+void ttl7474_device::preset_w(int state)
{
m_preset = state & 1;
update();
@@ -165,7 +164,7 @@ WRITE_LINE_MEMBER( ttl7474_device::preset_w )
// clock_w - set the clock line state
//-------------------------------------------------
-WRITE_LINE_MEMBER( ttl7474_device::clock_w )
+void ttl7474_device::clock_w(int state)
{
m_clk = state & 1;
update();
@@ -176,7 +175,7 @@ WRITE_LINE_MEMBER( ttl7474_device::clock_w )
// d_w - set the d line state
//-------------------------------------------------
-WRITE_LINE_MEMBER( ttl7474_device::d_w )
+void ttl7474_device::d_w(int state)
{
m_d = state & 1;
update();
@@ -187,7 +186,7 @@ WRITE_LINE_MEMBER( ttl7474_device::d_w )
// output_r - get the output line state
//-------------------------------------------------
-READ_LINE_MEMBER( ttl7474_device::output_r )
+int ttl7474_device::output_r()
{
return m_output!=0;
}
@@ -197,7 +196,7 @@ READ_LINE_MEMBER( ttl7474_device::output_r )
// output_comp_r - get the output-compare line state
//-----------------------------------------------------
-READ_LINE_MEMBER( ttl7474_device::output_comp_r )
+int ttl7474_device::output_comp_r()
{
return m_output_comp!=0;
}
@@ -210,6 +209,7 @@ void ttl7474_device::init()
m_d = 1;
m_output = -1;
+ m_output_comp = -1;
m_last_clock = 1;
m_last_output = -1;
m_last_output_comp = -1;