Implement interrupt status register
Upon an interrupt, you can read from the interrupt status register to see what caused the interrupt.
This commit is contained in:
@@ -9,6 +9,9 @@
|
||||
.import _handle_irq
|
||||
|
||||
.export _irq_int, _nmi_int
|
||||
.export _irq_get_status
|
||||
|
||||
.include "io.inc65"
|
||||
|
||||
.segment "CODE"
|
||||
|
||||
@@ -43,4 +46,9 @@ irq: PLA ; Restore accumulator contents
|
||||
; BRK detected, stop
|
||||
|
||||
break: JMP break ; If BRK is detected, something very bad
|
||||
; has happened, so stop running
|
||||
; has happened, so stop running
|
||||
|
||||
_irq_get_status:
|
||||
lda IRQ_STATUS
|
||||
ldx #$00
|
||||
rts
|
||||
Reference in New Issue
Block a user