safer NMI handling

This commit is contained in:
FeralChild64 committed 2020-06-04 22:19:10 +02:00
1 parent 1c118d9bc9
commit f8e57f1cf2
10 files changed
+114 -19

No files matched your search

+4 -5
View File
@@ -5,17 +5,16 @@
hw_entry_nmi:
sei // do not allow IRQ to interfere, see https://www.c64-wiki.com/wiki/Interrupt
sei // do not allow IRQ to interfere, see https://www.c64-wiki.com/wiki/Interrupt
#if CONFIG_CPU_MOS_6502 && CONFIG_BCD_SAFE_INTERRUPTS
cld // clear decimal flag to allow using it without disabling interrupts
cld // clear decimal flag to allow using it without disabling interrupts
#endif
// Call interrupt routine (only if initialised)
pha
lda NMINV
ora NMINV+1
beq !+
lda NMINV+1 // consider zeropage NMI address as uninitialized vector
beq !+ // this allows safer interrupt vector modifications
pla
jmp (NMINV)
!: