safer NMI handling
This commit is contained in:
1 parent
1c118d9bc9
commit
f8e57f1cf2
10 files changed
+114
-19
No files matched your search
@@ -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)
|
||||
!:
|
||||
|
||||
Reference in new issue
Block a user