Originally posted by sinseiga
I'm making time add block but when I touch it on 90 sec, timer overflows like *A*. How Can I prevent overflow in timer?
Basically, you just need to handle the overflow yourself. If any digits become 10 (0A) or more, subtract 10 from them and increase the next digit instead.
For instance, to add 30 seconds:
Code
LDA $0F32 CLC : ADC #$03 ; add 30 seconds. CMP #$0A ; is the tens digit greater than 10? BCC + SEC : SBC #$0A ; if so, subtract 10... INC $0F33 ; ...and increase the hundreds digit in its place + STA $0F32
If you're adding to the seconds digit (e.g. adding 5 seconds), you would do the same thing but checking both the tens digit and hundreds digit for overflow.
Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer