Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;#$15 - Max Right Walking Speed
- ;;#$31 - Max Right Running Speed
- ;;#$EB - Max Left Walking Speed
- ;;#$CF - Max Right Running Speed
- ;;$7E0073 - Is Mario Ducking flag - #$04 = yes ; Is not flagged as ducking while sliding.
- lorom
- org $00D600
- autoclean JML duck_check
- freecode
- duck_check:
- LDA $15 ;; / Original Code
- AND #$04 ;; | If Duck isn't pressed, stand up
- BEQ $D60B ;; \
- ;;If Mario is already Ducked resume
- LDA.W $7E0073
- CMP #$04
- BEQ resume
- LDA.W $7E007B ;; RAM address of Marios X Speed
- CMP #$EB ;; / If X Speed is greater then max left walking speed
- BCS force_stand ;; \ bigger number is slower so force stand
- CMP #$15 ;; / if X Speed is less then
- BCC force_stand ;; \ max right walking speed
- JML resume
- force_stand: ;; Enters here when speed is 14
- JML $00D60B
- resume:
- LDA $15 ;; We jump back to an STA so need to restore A
- AND.B #$04 ;; back to exactly how it was
- JML $00D606 ;; Jump back to regular execution
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement