From e669b5ef466f5f83fb3b10e61752fad467fc1582 Mon Sep 17 00:00:00 2001 From: AJR Date: Wed, 20 Jan 2021 13:05:37 -0500 Subject: m740: NMI does not exist; update notes --- src/devices/cpu/m6502/om740.lst | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/devices/cpu/m6502/om740.lst b/src/devices/cpu/m6502/om740.lst index d912d1560ad..86e09028517 100644 --- a/src/devices/cpu/m6502/om740.lst +++ b/src/devices/cpu/m6502/om740.lst @@ -182,7 +182,7 @@ jsr_zpi stp_imp read_pc_noinc(); logerror("STP at $%04x\n", PC); - while(!nmi_pending && !irq_state) { + while(!irq_state) { eat-all-cycles; } prefetch(); @@ -190,7 +190,7 @@ stp_imp wit_imp read_pc_noinc(); logerror("WIT at $%04x\n", PC); - while(!nmi_pending && !irq_state) { + while(!irq_state) { eat-all-cycles; } prefetch(); @@ -209,7 +209,6 @@ reset_m inst_state = -1; brk_m_imp - // The 6502 bug when a nmi occurs in a brk is reproduced (case !irq_taken && nmi_pending) if(irq_taken) { read_pc_noinc(); } else { @@ -221,17 +220,11 @@ brk_m_imp dec_SP(); write(SP, irq_taken ? P & ~F_B : P); dec_SP(); - if(nmi_pending) { - PC = read_arg(0xfffa); - PC = set_h(PC, read_arg(0xfffb)); - nmi_pending = false; - standard_irq_callback(NMI_LINE); - } else { - PC = read_arg(m_irq_vector); - PC = set_h(PC, read_arg(m_irq_vector+1)); - if(irq_taken) - standard_irq_callback(IRQ_LINE); - } + // BRK uses the vector of the interrupt with the highest priority if any are enabled and pending + PC = read_arg(m_irq_vector); + PC = set_h(PC, read_arg(m_irq_vector+1)); + if(irq_taken) + standard_irq_callback(IRQ_LINE); irq_taken = false; P |= F_I; // Do *not* move after the prefetch prefetch(); @@ -689,6 +682,7 @@ inc_m_zpx prefetch(); jmp_m_ind + // JMP ($XXFF) has the same bug as on the NMOS 6502 TMP = read_pc(); TMP = set_h(TMP, read_pc()); PC = read_data(TMP); -- cgit v1.2.3