diff options
author | 2018-05-04 09:54:47 -0400 | |
---|---|---|
committer | 2018-05-04 09:54:47 -0400 | |
commit | d6ec6061c8b48e27b280d131362ed29eaababb2a (patch) | |
tree | 10848219aa3735f1fec2ed4197081b8deebc1d40 /src | |
parent | 1ae8286955a321ba7da022878baa367d640adf3d (diff) | |
parent | 0f86f547c621d6f78455e991667b999b45fd0b34 (diff) |
Merge pull request #3518 from fulivi/hpipc_dev2
tms9914: added methods to read ACCRQ & CONT output lines
Diffstat (limited to 'src')
-rw-r--r-- | src/devices/machine/tms9914.cpp | 27 | ||||
-rw-r--r-- | src/devices/machine/tms9914.h | 13 |
2 files changed, 39 insertions, 1 deletions
diff --git a/src/devices/machine/tms9914.cpp b/src/devices/machine/tms9914.cpp index d0b2483ec6a..7c3d0ec7f3a 100644 --- a/src/devices/machine/tms9914.cpp +++ b/src/devices/machine/tms9914.cpp @@ -187,7 +187,8 @@ tms9914_device::tms9914_device(const machine_config &mconfig, const char *tag, d devcb_write_line(*this), devcb_write_line(*this), devcb_write_line(*this) }, - m_int_write_func(*this) + m_int_write_func(*this), + m_accrq_write_func(*this) { // Silence compiler complaints about unused variables (void)REG_INT0_RLC_BIT; @@ -284,6 +285,7 @@ WRITE8_MEMBER(tms9914_device::reg8_w) case REG_W_DO: m_reg_do = data; + set_accrq(false); if (!m_swrst) { BIT_CLR(m_reg_int0_status , REG_INT0_BO_BIT); update_int(); @@ -388,6 +390,9 @@ READ8_MEMBER(tms9914_device::reg8_r) case REG_R_DI: res = m_reg_di; + BIT_CLR(m_reg_int0_status , REG_INT0_BI_BIT); + update_int(); + set_accrq(false); if (!m_hdfa && m_ah_anhs) { m_ah_anhs = false; update_fsm(); @@ -405,6 +410,11 @@ READ8_MEMBER(tms9914_device::reg8_r) return res; } +READ_LINE_MEMBER(tms9914_device::cont_r) +{ + return m_c_state != FSM_C_CIDS && m_c_state != FSM_C_CADS; +} + // device-level overrides void tms9914_device::device_start() { @@ -414,6 +424,7 @@ void tms9914_device::device_start() f.resolve_safe(); } m_int_write_func.resolve_safe(); + m_accrq_write_func.resolve_safe(); m_sh_dly_timer = timer_alloc(SH_DELAY_TMR_ID); m_ah_dly_timer = timer_alloc(AH_DELAY_TMR_ID); @@ -435,6 +446,7 @@ void tms9914_device::device_reset() m_stdl = false; m_shdw = false; m_vstdl = false; + m_accrq_line = true; // Ensure change is propagated m_reg_serial_p = 0; m_reg_parallel_p = 0; @@ -536,6 +548,7 @@ void tms9914_device::do_swrst() m_c_state = FSM_C_CIDS; update_int(); + set_accrq(false); } bool tms9914_device::listener_reset() const @@ -1312,6 +1325,9 @@ void tms9914_device::set_int0_bit(unsigned bit_no) { BIT_SET(m_reg_int0_status , bit_no); update_int(); + if (bit_no == REG_INT0_BI_BIT || (bit_no == REG_INT0_BO_BIT && m_c_state != FSM_C_CACS)) { + set_accrq(true); + } } void tms9914_device::set_int1_bit(unsigned bit_no) @@ -1351,3 +1367,12 @@ void tms9914_device::update_ren() { set_signal(IEEE_488_REN , m_sre); } + +void tms9914_device::set_accrq(bool state) +{ + if (state != m_accrq_line) { + LOG_INT("ACCRQ=%d\n" , state); + m_accrq_line = state; + m_accrq_write_func(m_accrq_line); + } +} diff --git a/src/devices/machine/tms9914.h b/src/devices/machine/tms9914.h index cb91a3ff87e..3470ece1f92 100644 --- a/src/devices/machine/tms9914.h +++ b/src/devices/machine/tms9914.h @@ -69,6 +69,10 @@ #define MCFG_TMS9914_INT_WRITE_CB(_write) \ downcast<tms9914_device &>(*device).set_int_write_cb(DEVCB_##_write); +// Set write callback for ACCRQ signal +#define MCFG_TMS9914_ACCRQ_WRITE_CB(_write) \ + downcast<tms9914_device &>(*device).set_accrq_write_cb(DEVCB_##_write); + class tms9914_device : public device_t { public: @@ -100,6 +104,9 @@ public: template <class Object> devcb_base& set_int_write_cb(Object &&cb) { return m_int_write_func.set_callback(std::forward<Object>(cb)); } + template <class Object> devcb_base& set_accrq_write_cb(Object &&cb) + { return m_accrq_write_func.set_callback(std::forward<Object>(cb)); } + DECLARE_WRITE_LINE_MEMBER(eoi_w); DECLARE_WRITE_LINE_MEMBER(dav_w); DECLARE_WRITE_LINE_MEMBER(nrfd_w); @@ -112,6 +119,9 @@ public: DECLARE_WRITE8_MEMBER(reg8_w); DECLARE_READ8_MEMBER(reg8_r); + // CONT output: true when 9914 is current controller-in-charge + DECLARE_READ_LINE_MEMBER(cont_r); + private: // device-level overrides virtual void device_start() override; @@ -122,7 +132,9 @@ private: devcb_write8 m_dio_write_func; devcb_write_line m_signal_wr_fns[ IEEE_488_SIGNAL_COUNT ]; devcb_write_line m_int_write_func; + devcb_write_line m_accrq_write_func; bool m_int_line; + bool m_accrq_line; uint8_t m_dio; bool m_signals[ IEEE_488_SIGNAL_COUNT ]; @@ -288,6 +300,7 @@ private: void update_int(); void update_ifc(); void update_ren(); + void set_accrq(bool state); }; // device type definition |