Execute a macro every second

abenjack

New member
Hi all,
I would like execute my macro every second increasing the value of the parameter varX. For this feature I'm using the HandleGameTimer.asm file, with something like this:

LDA gameTimerTicks CLC ADC #$01 ;how fast to run STA gameTimerTicks BCC +normalwhatever SubtractValue #$02, myTimer, #$1, #$00 ;;arg0 = how places value has ;;arg1 - home variable ;;arg2 = amount to subtract ;;arg3 = what place value is receiving subtaction UpdateHudElement #$05 PLA CLC ADC #02 STA varX MyMacro varX, #$02 PHA +normalwhatever LDA gameTimerLo ADC #$00 STA gameTimerLo LDA gameTimerHi ADC #$00 STA gameTimerHi

I need to increase the value of varX by 2 every second (or every X second, it depends). With the solution I posted the parameter value is set correctly just the first time. Can you find the issue?
Thanks in advance
 
Top Bottom