Fix bug that causes one-shot timers to loop forever

This commit is contained in:
Lucas Scharenbroich 2021-08-24 15:58:36 -05:00
parent 48bb361730
commit 740a0f260d
1 changed files with 9 additions and 2 deletions

View File

@ -182,11 +182,16 @@ _DoTimers
plx
pla
lda Timers+2,x ; Load the reset value, if it's zero
beq :oneshot ; then this was a one-shot timer
clc
adc Timers+2,x ; Add the increment
sta Timers,x ; Store in the count
adc Timers,x ; Add to the current count and store
sta Timers,x
bra :retry ; See if we have >0 ticks to wait until the next trigger
:oneshot stz Timers,x
:skip txa
clc
adc #8
@ -232,6 +237,8 @@ _DoTimers