Switch_SonicAlone: ; Sonic alone Switch
cmp.w #1,($FFFFFF72).w ; Check for Sonic Alone
beq.w @return ; If yes, skip character switch
tst.b (a3) ; Test something
bne.w @return ; If not zero, skip character switch
move.w #$CD,d0 ; Play sound $CD
jsr (PlaySound).w ; jump to PlaySound
jsr (SingleObjLoad).l ; Load a new object in the SST
move.b #$27,0(a1) ; Load puff of smoke object
move.w ($FFFFB008).w,8(a1) ; Copy player's X coordinate onto the smoke object
move.w ($FFFFB00C).w,$C(a1) ; Copy player's Y coordinate onto the smoke object
move.b #1,$34(a1) ; Skip creating animal
move.l a0,-(sp) ; Backup the current value of a0 to the stack
lea ($FFFFB000).w,a0 ; Delete character object
jsr (DeleteObject).l
lea ($FFFFB040).w,a0 ; Delete Tails object, if it exists
jsr (DeleteObject).l
move.l (sp)+,a0 ; Restore the value of a0 from the stack
move.b #1,($FFFFB000).w ; Load Sonic object
move.w 8(a1),($FFFFB008).w ; Reload Sonic's X coordinate
move.w $C(a1),($FFFFB00C).w ; Reload Sonic's Y coordinate
move.w #$0822,($FFFFFB04).w ; Restore Sonic's blues, in case we were playing as Knuckles
move.w #$0C42,($FFFFFB06).w
move.w #$0E64,($FFFFFB08).w
move.w #$0E66,($FFFFFB0A).w
move.l #$00010001,($FFFFFF70).w ; Set current character variables to 1 ($FF70 and $FF72).
@return:
bset d3,(a3) ; I don't know what any of this does...
move.b #1,$1A(a0)
bra.w loc_24D92