Introduce NMIs

This commit is contained in:
Greg Shuflin 2022-06-16 14:33:46 -07:00
parent a5d8084260
commit 1c6fdd3468
1 changed files with 14 additions and 1 deletions

View File

@ -7,6 +7,10 @@
.include "header.asm"
.segment "ZEROPAGE"
nmi_count: .res 2
.segment "CODE"
VRAM_CHARS = $0000
@ -93,10 +97,18 @@ start:
lda #$0f
sta INIDISP
lda #$01
lda #%10000001
sta NMITIMEN
mainloop:
lda nmi_count
nmi_check:
wai
cmp nmi_count
beq nmi_check
lda JOY1L
bit #JOYL_L
beq down_not_pressed
@ -117,6 +129,7 @@ busywait:
nmi:
bit RDNMI
inc nmi_count
_rti:
rti