LDA Object_physics_byte,x
AND #%00000001 ;; is it on the ground?
;;check if in a jumping state.
TXA
STA temp
GetActionStep temp
CMP #$02 ;; presums jump is in state 2
BNE +dontChangeToIdle
LDA gamepad
AND #%11110000
BNE +isRunningWhenLanding
;; is idle when landing
LDA #$00
STA temp1
JMP +gotLandingState
+isRunningWhenLanding
LDA #$01
STA temp1
+gotLandingState
ChangeActionStep temp, temp1 ;; changes to either idle or running depending on if a direction key is pressed.
+dontChangeToIdle