1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-08-15 14:27:29 +00:00

Ensures NMI can no longer usurp BRK on 65C02s.

This commit is contained in:
Thomas Harte
2018-08-14 19:33:48 -04:00
parent be01203cc1
commit 1eca4463b3

View File

@@ -140,9 +140,13 @@ if(number_of_cycles <= Cycles(0)) break;
case CycleReadFromPC: throwaway_read(pc_.full); break; case CycleReadFromPC: throwaway_read(pc_.full); break;
case OperationBRKPickVector: case OperationBRKPickVector:
// NMI can usurp BRK-vector operations if(is_65c02(personality)) {
nextAddress.full = (interrupt_requests_ & InterruptRequestFlags::NMI) ? 0xfffa : 0xfffe; nextAddress.full = 0xfffe;
interrupt_requests_ &= ~InterruptRequestFlags::NMI; // TODO: this probably doesn't happen now? } else {
// NMI can usurp BRK-vector operations on the pre-C 6502s.
nextAddress.full = (interrupt_requests_ & InterruptRequestFlags::NMI) ? 0xfffa : 0xfffe;
interrupt_requests_ &= ~InterruptRequestFlags::NMI;
}
continue; continue;
case OperationNMIPickVector: nextAddress.full = 0xfffa; continue; case OperationNMIPickVector: nextAddress.full = 0xfffa; continue;
case OperationRSTPickVector: nextAddress.full = 0xfffc; continue; case OperationRSTPickVector: nextAddress.full = 0xfffc; continue;