mirror of
https://github.com/lscharen/iigs-game-engine.git
synced 2024-11-15 10:05:02 +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
|
plx
|
||||||
pla
|
pla
|
||||||
|
|
||||||
|
lda Timers+2,x ; Load the reset value, if it's zero
|
||||||
|
beq :oneshot ; then this was a one-shot timer
|
||||||
|
|
||||||
clc
|
clc
|
||||||
adc Timers+2,x ; Add the increment
|
adc Timers,x ; Add to the current count and store
|
||||||
sta Timers,x ; Store in the count
|
sta Timers,x
|
||||||
bra :retry ; See if we have >0 ticks to wait until the next trigger
|
bra :retry ; See if we have >0 ticks to wait until the next trigger
|
||||||
|
|
||||||
|
:oneshot stz Timers,x
|
||||||
|
|
||||||
:skip txa
|
:skip txa
|
||||||
clc
|
clc
|
||||||
adc #8
|
adc #8
|
||||||
@ -232,6 +237,8 @@ _DoTimers
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user