mirror of
https://github.com/lscharen/iigs-game-engine.git
synced 2024-11-22 11:34:14 +00:00
Fix bug that causes one-shot timers to loop forever
This commit is contained in:
parent
48bb361730
commit
740a0f260d
11
src/Timer.s
11
src/Timer.s
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user