Fix remaining uses of fade

This commit is contained in:
dannye 2021-03-30 01:06:32 -05:00
parent 37d3ba4b39
commit b2afaae7ab
14 changed files with 43 additions and 62 deletions

View file

@ -60,17 +60,19 @@ PlayDefaultMusicCommon::
.next4
ld a, c
ld [wAudioFadeOutControl], a
and a
jr nz, .next5
inc a
.next5
ld [wMusicFade], a
ld a, b
ld [wLastMusicSoundID], a
; ld [wNewSoundID], a
ld [wMusicFadeID], a
; if no fade, play immediately
ld a, [wMusicFade]
and a
jr nz, .next5
ld a, b
call PlayMusic
.next5
ret
;UpdateMusic6Times::

View file

@ -130,8 +130,8 @@ StopAllSounds::
; ld [wAudioROMBank], a
; ld [wAudioSavedROMBank], a
xor a
ld [wAudioFadeOutControl], a
; ld [wNewSoundID], a
ld [wMusicFade], a
ld [wMusicFadeID], a
ld [wLastMusicSoundID], a
dec a
jp PlaySound

View file

@ -760,7 +760,6 @@ HandleBlackOut::
call GBFadeOutToBlack
ld a, $08
call StopMusic
call WaitForSongToFinish
ld hl, wd72e
res 5, [hl]
ld a, BANK(ResetStatusAndHalveMoneyOnBlackout) ; also BANK(SpecialWarpIn) and BANK(SpecialEnterMap)
@ -775,24 +774,11 @@ StopMusic::
ld [wMusicFade], a
xor a
ld [wMusicFadeID], a
.wait0
ld a, [wMusicFadeCount]
.wait
ld a, [wMusicFade]
and a
jr z, .wait0
.wait1
ld a, [wMusicFadeCount]
and a
jr nz, .wait1
ret
; ld [wAudioFadeOutControl], a
; ld a, SFX_STOP_ALL_MUSIC
; ld [wNewSoundID], a
; call PlaySound
;.wait
; ld a, [wAudioFadeOutControl]
; and a
; jr nz, .wait
; jp StopAllSounds
jr nz, .wait
jp StopAllSounds
HandleFlyWarpOrDungeonWarp::
call UpdateSprites

View file

@ -406,7 +406,7 @@ PlayTrainerMusic::
and a
ret nz
xor a
ld [wAudioFadeOutControl], a
ld [wMusicFade], a
ld a, SFX_STOP_ALL_MUSIC
call PlaySound
; ld a, 0 ; BANK(Music_MeetEvilTrainer)