SLeappery

by circlefriendo

Game: SMW

Description: Combining multiple scripts into one to save slots

!previous_jump = $7f9e02
!previous_facing = $7f9e03

!jump = $72
!facing = $76
!xspeed = $7b

lda !jump
and #$08   
beq store_previous   ; if jumping

lda !previous_jump
bne store_previous   ; and previously grounded

leap:          ; activate leap

lda #$3f
sta !xspeed    ; right facing speed

lda !facing
bne store_previous        ; if facing left

lda #$c0
sta !xspeed    ; left facing speed

store_previous:

lda !jump
sta !previous_jump

lda !facing
sta !previous_facing

!previous_xspeed = $7f9e01

!jump = $72
!blocked = $77    ;RAM_MarioObjStatus
!xspeed = $7b
!goaltimer = $1493
!gamemode = $0100

lda !gamemode
cmp #$14 ; Normal Level
bne end        ; if inside a level

lda !goaltimer
bne normal        ; and not goal tape

lda !jump
bne normal        ; and not airborne

lda !blocked
and #$03
bne normal        ; and not blocked

lda !previous_xspeed
sta !xspeed       ; make slippery

normal:
lda !xspeed
sta !previous_xspeed

end:
rtl
back to listings