rtc65271: Use existing interrupt flag for intrq_r. (nw)

This commit is contained in:
Michael Zapf 2020-04-10 16:28:16 +02:00
parent c884456767
commit 03df5583d5
2 changed files with 1 additions and 7 deletions

View File

@ -450,14 +450,12 @@ void rtc65271_device::field_interrupts()
{ {
if (m_regs[reg_C] & m_regs[reg_B] & (reg_C_PF | reg_C_AF | reg_C_UF)) if (m_regs[reg_C] & m_regs[reg_B] & (reg_C_PF | reg_C_AF | reg_C_UF))
{ {
m_int_pending = true;
m_regs[reg_C] |= reg_C_IRQF; m_regs[reg_C] |= reg_C_IRQF;
if (!m_interrupt_cb.isnull()) if (!m_interrupt_cb.isnull())
m_interrupt_cb(1); m_interrupt_cb(1);
} }
else else
{ {
m_int_pending = false;
m_regs[reg_C] &= ~reg_C_IRQF; m_regs[reg_C] &= ~reg_C_IRQF;
if (!m_interrupt_cb.isnull()) if (!m_interrupt_cb.isnull())
m_interrupt_cb(0); m_interrupt_cb(0);
@ -466,7 +464,7 @@ void rtc65271_device::field_interrupts()
READ_LINE_MEMBER(rtc65271_device::intrq_r) READ_LINE_MEMBER(rtc65271_device::intrq_r)
{ {
return (m_int_pending)? ASSERT_LINE : CLEAR_LINE; return (m_regs[reg_C] & reg_C_IRQF)? ASSERT_LINE : CLEAR_LINE;
} }
/* /*
@ -662,7 +660,6 @@ rtc65271_device::rtc65271_device(const machine_config &mconfig, const char *tag,
: device_t(mconfig, RTC65271, tag, owner, clock) : device_t(mconfig, RTC65271, tag, owner, clock)
, device_nvram_interface(mconfig, *this) , device_nvram_interface(mconfig, *this)
, m_interrupt_cb(*this) , m_interrupt_cb(*this)
, m_int_pending(false)
{ {
} }
@ -681,5 +678,4 @@ void rtc65271_device::device_start()
save_item(NAME(m_xram)); save_item(NAME(m_xram));
save_item(NAME(m_cur_xram_page)); save_item(NAME(m_cur_xram_page));
save_item(NAME(m_SQW_internal_state)); save_item(NAME(m_SQW_internal_state));
save_item(NAME(m_int_pending));
} }

View File

@ -63,8 +63,6 @@ private:
/* callback called when interrupt pin state changes (may be nullptr) */ /* callback called when interrupt pin state changes (may be nullptr) */
devcb_write_line m_interrupt_cb; devcb_write_line m_interrupt_cb;
bool m_int_pending;
}; };
// device type definition // device type definition