Introduce NMIs
This commit is contained in:
parent
a5d8084260
commit
1c6fdd3468
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user