End of Level BGM Fade Out - RetroKoH/S1Fixed GitHub Wiki

(Original guide by RetroKoH)
Source: See commits
Original Commit: f1283cb
This mod can be toggled in S1Fixed by setting EndLevelFadeMusic to 0 or 1.

In the Sonic remakes, the level music would fade out as the level ended. This was not in the original games, despite the fact that it is possible, and is quite easy to do! This is a really small change compared to the originals, but if you want to apply this change, here's how you do it!

First, open _incObj/0D Signpost.asm and find the label Sign_Spin. We will add a couple of lines at the end:

Sign_Spin:	; Routine 4
	subq.w	#1,spintime(a0)		; subtract 1 from spin time
	bpl.s	.chksparkle		; if time remains, branch
	move.w	#60,spintime(a0)	; set spin cycle time to 1 second
	addq.b	#1,obAnim(a0)		; next spin cycle
	cmpi.b	#3,obAnim(a0)		; have 3 spin cycles completed?
	bne.s	.chksparkle		; if not, branch
+	move.b	#bgm_Fade,d0
+	jsr	PlaySound_Special	; fade out music
	addq.b	#2,obRoutine(a0)

We still need to do this with Prison Capsules. Open _incObj/3E Prison Capsule.asm and find .noanimal. We are going to add the exact same lines here:

.noanimal:
	subq.w	#1,obTimeFrame(a0)
	bne.s	.wait
+	move.b	#bgm_Fade,d0
+	jsr	PlaySound_Special	; fade out music
	addq.b	#2,obRoutine(a0)
	move.w	#180,obTimeFrame(a0)

And that's it! It's possible we could apply a similar effect to Scrap Brain 3, though that might require some extra work to get the fade-out transition to wait for the fade out to occur. Final Zone could have a fade out trigger as Eggman flies off... I'll consider making adjustments for these.