Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Block500:
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;Sprite Morph v2
- ;;By Erik557
- ;;Description: Turns a sprite into another one.
- ;;It has configurable settings.
- ;;No credit needed.
- ;;NOTE: Needs NMSTL
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- !SpriteType = 0 ;0 = Normal; 1 = Custom
- !SprNum = $0F ;Sprite number
- !SprMorph = $10 ;Morph Result
- !SA1 = 1 ;SA-1 Utilisation (doesn't work with GPS)
- !Sound = $10 ;SFX
- if !SA1 == 1
- !SFXBank = $7DF9 ;SFX Bank (SA-1)
- !Slots = 22 ;Sprite Slots (SA-1)
- else
- !SFXBank = $1DF9 ;SFX Bank
- !Slots = 12 ;Sprite Slots
- endif
- ;Don't touch these.
- if !SpriteType == 1
- if !SA1 == 1
- !Status = $3242
- !SprRAM = $400083
- !Extra = $400040
- else
- !Status = $14C8
- !SprRAM = $7FAB9E
- !Extra = $7FAB10
- endif
- else
- if !SA1 == 1
- !Status = $3242
- !SprRAM = $3200
- !Extra = $400040
- else
- !Status = $14C8
- !SprRAM = $9E
- !Extra = $7FAB10
- endif
- endif
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- .SpriteVert
- .SpriteHoriz
- LDA !SprRAM,x
- CMP #!SprNum
- BNE Ret
- LDA !Extra,x
- AND #$08
- if !SpriteType == 1
- BNE MorphIt
- else
- BEQ MorphIt
- endif
- .PlayerBelow
- .PlayerAbove
- .PlayerSides
- .PlayerTopCorner
- .PlayerBodyInside
- .PlayerHeadInside
- .CapeTouch
- .FireballTouch
- Ret:
- RTL
- MorphIt:
- STZ !Status,x
- if !SA1 == 1
- LDA #!Sound
- STA !SFXBank
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;Manual Spawn Routine
- ;;Generates a sprite. Compatible with manual custom
- ;;block inserter, and with SA-1.
- ;;Adapted from %spawn_sprite() GPS routine.
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- PHX
- LDX #!Slots-1
- - LDA !Status,x
- BEQ +
- DEX
- BPL -
- BRA .no
- + LDA #!SprMorph
- STA !SprRAM,x
- JSL $07F7D2
- if !SpriteType == 1
- JSL $0187A7
- LDA #$08
- STA !Extra,x
- endif
- LDA #$01
- STA !Status,x
- TXA
- PLX
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;Fix sprite position
- ;;Adapted from %move_spawn_to_sprite() GPS routine.
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- PHY
- TAY
- LDA $3216,x
- STA $3216,y
- LDA $3258,x
- STA $3258,y
- LDA $322C,x
- STA $322C,y
- LDA $326E,x
- STA $326E,y
- PLY
- RTL
- .no PLX : RTL
- else
- LDA #!SprMorph
- if !SpriteType == 1
- SEC
- else
- CLC
- endif
- %spawn_sprite()
- %move_spawn_to_sprite()
- %create_smoke()
- LDA #!Sound
- STA !SFXBank
- endif
- RTL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement