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:
Byron Lathi
2022-03-14 13:30:01 -05:00
parent e012eb7d4d
commit a5474b5ae5
5 changed files with 46 additions and 1 deletions

View File

@@ -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