CFCombo

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



module2:

!previous_xspeed = $7f9e01

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

lda !gamemode
cmp #$14 ; Normal Level
bne module3        ; 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

module3:

; avoid the music trigger at $1490 = #$1e
lda $1490
eor #$1f
beq zero

; trigger every 256? frames
lda $14
bne module4

; gib star
lda #$40
sta $1490

zero:
lda #$00
sta $1490

module4:

end:
rtl
back to listings