diff options
author | 2010-08-25 12:10:26 +0000 | |
---|---|---|
committer | 2010-08-25 12:10:26 +0000 | |
commit | dfd42f5df1d6bb436c58efdf59ff27d062a85026 (patch) | |
tree | 68e4ce5bd3b0f648998a057a1d80322bea3b1c36 /src/emu/machine | |
parent | 050e2b94b070e896b93f527e03b9480225668721 (diff) |
Prospective fix for Phil's r2dtank crash, which I'm not getting. No whatsnew.
Diffstat (limited to 'src/emu/machine')
-rw-r--r-- | src/emu/machine/74123.c | 56 |
1 files changed, 50 insertions, 6 deletions
diff --git a/src/emu/machine/74123.c b/src/emu/machine/74123.c index ebb9be8e2ce..2101c184c01 100644 --- a/src/emu/machine/74123.c +++ b/src/emu/machine/74123.c @@ -57,7 +57,22 @@ device_t *ttl74123_device_config::alloc_device(running_machine &machine) const void ttl74123_device_config::device_config_complete() { + // inherit a copy of the static data + const ttl74123_interface *intf = reinterpret_cast<const ttl74123_interface *>(static_config()); + if (intf != NULL) + *static_cast<ttl74123_interface *>(this) = *intf; + // or initialize to defaults if none provided + else + { + m_connection_type = TTL74123_NOT_GROUNDED_NO_DIODE; + m_res = 1.0; + m_cap = 1.0; + m_a = 0; + m_b = 0; + m_clear = 0; + memset(&m_output_changed_cb, 0, sizeof(m_output_changed_cb)); + } } @@ -109,9 +124,9 @@ void ttl74123_device::device_reset() -/*------------------------------------------------- - compute_duration --------------------------------------------------*/ +//------------------------------------------------- +// compute_duration - compute timer duration +//------------------------------------------------- attotime ttl74123_device::compute_duration() { @@ -145,9 +160,9 @@ attotime ttl74123_device::compute_duration() } -/*------------------------------------------------- - timer_running --------------------------------------------------*/ +//------------------------------------------------- +// timer_running - is the timer running? +//------------------------------------------------- int ttl74123_device::timer_running() { @@ -172,6 +187,10 @@ void ttl74123_device::output(INT32 param) } +//------------------------------------------------- +// set_output - set the output line state +//------------------------------------------------- + void ttl74123_device::set_output() { int output = timer_running(); @@ -182,6 +201,10 @@ void ttl74123_device::set_output() } +/*------------------------------------------------- + TIMER_CALLBACK( clear_callback ) +-------------------------------------------------*/ + TIMER_CALLBACK( ttl74123_device::clear_callback ) { ttl74123_device *dev = reinterpret_cast<ttl74123_device*>(ptr); @@ -196,6 +219,10 @@ void ttl74123_device::clear() } +//------------------------------------------------- +// start_pulse - begin timing +//------------------------------------------------- + void ttl74123_device::start_pulse() { attotime duration = compute_duration(); @@ -228,6 +255,10 @@ void ttl74123_device::start_pulse() } +//------------------------------------------------- +// a_w - write register a data +//------------------------------------------------- + WRITE8_DEVICE_HANDLER( ttl74123_a_w ) { ttl74123_device *dev = downcast<ttl74123_device *>(device); @@ -246,6 +277,10 @@ void ttl74123_device::a_w(UINT8 data) } +//------------------------------------------------- +// b_w - write register b data +//------------------------------------------------- + WRITE8_DEVICE_HANDLER( ttl74123_b_w ) { ttl74123_device *dev = downcast<ttl74123_device *>(device); @@ -264,6 +299,10 @@ void ttl74123_device::b_w(UINT8 data) } +//------------------------------------------------- +// clear_w - write register clear data +//------------------------------------------------- + WRITE8_DEVICE_HANDLER( ttl74123_clear_w ) { ttl74123_device *dev = downcast<ttl74123_device *>(device); @@ -286,6 +325,11 @@ void ttl74123_device::clear_w(UINT8 data) m_clear = data; } + +//------------------------------------------------- +// reset_w - reset device +//------------------------------------------------- + WRITE8_DEVICE_HANDLER( ttl74123_reset_w ) { ttl74123_device *dev = downcast<ttl74123_device *>(device); |