diff options
author | 2020-10-29 11:26:51 -0400 | |
---|---|---|
committer | 2020-10-29 11:27:34 -0400 | |
commit | bf80796b1555aa2e4e66f01b52a54a08aca0522c (patch) | |
tree | db87290ab18b2e30512f3e23a313b3a60661f12f /src/devices/cpu/m6502/m5074x.cpp | |
parent | 282a8d49a9a820eb5c6f0ba1678b2b0f3c25e409 (diff) |
m5074x.cpp: Protect interrupt request bits against being set by writes
- m740: A few more timing corrections
Diffstat (limited to 'src/devices/cpu/m6502/m5074x.cpp')
-rw-r--r-- | src/devices/cpu/m6502/m5074x.cpp | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/src/devices/cpu/m6502/m5074x.cpp b/src/devices/cpu/m6502/m5074x.cpp index 8b0c879b554..46e6fffc9ae 100644 --- a/src/devices/cpu/m6502/m5074x.cpp +++ b/src/devices/cpu/m6502/m5074x.cpp @@ -164,16 +164,13 @@ void m5074x_device::execute_set_input(int inputnum, int state) { switch (inputnum) { - case M5074X_INT1_LINE: - if (state == ASSERT_LINE) - { - m_intctrl |= IRQ_INTREQ; - } - else - { - m_intctrl &= ~IRQ_INTREQ; - } - break; + case M5074X_INT1_LINE: + // FIXME: edge-triggered + if (state == ASSERT_LINE) + { + m_intctrl |= IRQ_INTREQ; + } + break; } recalc_irqs(); @@ -442,12 +439,13 @@ void m5074x_device::tmrirq_w(offs_t offset, uint8_t data) break; case 5: - m_intctrl = data; + // Interrupt request bits can only be reset + m_intctrl = data & (m_intctrl | ~(IRQ_CNTRREQ | IRQ_INTREQ)); recalc_irqs(); break; case 6: - m_tmrctrl = data; + m_tmrctrl = data & (m_tmrctrl | ~TMRC_TMRXREQ); recalc_irqs(); break; } @@ -589,25 +587,19 @@ void m50753_device::execute_set_input(int inputnum, int state) switch (inputnum) { case M50753_INT1_LINE: + // FIXME: edge-triggered if (state == ASSERT_LINE) { m_intctrl |= IRQ_50753_INT1REQ; } - else - { - m_intctrl &= ~IRQ_50753_INT1REQ; - } break; case M50753_INT2_LINE: + // FIXME: edge-triggered if (state == ASSERT_LINE) { m_intctrl |= IRQ_50753_INT2REQ; } - else - { - m_intctrl &= ~IRQ_50753_INT2REQ; - } break; } |