loc_1A2B8: bsr.w loc_1AC3E bsr.w loc_1AA38 bsr.w loc_1AD96 bsr.w loc_1A35A bsr.w loc_1A9D2 bsr.w loc_1A974 bsr.s ChkWalk jsr sub_163AC bsr.w loc_1E234 bsr.w loc_1AE08 locret_1A2DE: rts walk: btst #6,($FFFFF602).w ; check if a is held beq.s nwalk ; branch if not tst.b (Sonic_Walking).w ; is sonic already walking? bne.s walk_return ; branch if he is cmpi.w #0,$14(a0) ; check sonic is moving beq.s walk_return ; branch if not move.w #$400,(Sonic_top_speed).w move.w #$C,(Sonic_acceleration).w move.w #$80,(Sonic_deceleration).w move.b #1,(Sonic_Walking).w ; set the walking flat btst #0,$22(a0) ; check direction bne.s walkl move.w #$300,$14(a0) ; right rts walkl: move.w #-$300,$14(a0) ; left rts nwalk: tst.b (Sonic_Walking).w ;is the sonic walking flag set bne.s run ;then let him run again walk_return: ;otherwise, do nothing rts run: move.w #$600,(Sonic_top_speed).w move.w #$C,(Sonic_acceleration).w move.w #$80,(Sonic_deceleration).w clr.b (Sonic_Walking).w ; clear the walking flag ;walkwalkwalk rts