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

@ -38,7 +38,9 @@ Music_RivalAlternateStartAndTempo::
; an alternate tempo for Cities1 which is used for the Hall of Fame room
Music_Cities1AlternateTempo::
ld a, 10
call StopMusic
ld [wMusicFade], a
xor a
ld [wMusicFadeID], a
ld c, 100
call DelayFrames ; wait for the fade-out to finish
ld c, 0 ; BANK(Music_Cities1)

View file

@ -1,8 +1,7 @@
PlayBattleMusic::
xor a
ld [wAudioFadeOutControl], a
ld [wLowHealthAlarm], a
ld [wMusicFade], a
ld [wLowHealthAlarm], a
dec a ; SFX_STOP_ALL_MUSIC
; ld [wNewSoundID], a
call PlayMusic

View file

@ -884,7 +884,7 @@ TradeJumpPokeball:
cp $ff
jr nz, .skipPlayingSound
.playSound ; play sound if next move distance is 12 or this is the last one
ld a, SFX_BATTLE_18
ld a, SFX_SWAP
call PlaySound
.skipPlayingSound
push bc

View file

@ -30,7 +30,7 @@ SafariZoneGameStillGoing:
SafariZoneGameOver:
call EnableAutoTextBoxDrawing
xor a
ld [wAudioFadeOutControl], a
ld [wMusicFade], a
dec a ; SFX_STOP_ALL_MUSIC
call PlaySound
ld c, 0 ; BANK(SFX_Safari_Zone_PA)

View file

@ -24,7 +24,7 @@ DisplayPokemonCenterDialogue_::
predef HealParty
farcall AnimateHealingMachine ; do the healing machine animation
xor a
ld [wAudioFadeOutControl], a
ld [wMusicFade], a
; ld a, [wAudioSavedROMBank]
; ld [wAudioROMBank], a
ld a, [wMapMusicSoundID]

View file

@ -825,12 +825,12 @@ TradeCenter_Trade:
ld a, [hl]
ld [wTradedEnemyMonSpecies], a
ld a, 10
ld [wAudioFadeOutControl], a
ld [wMusicFade], a
; ld a, 0 ; BANK(Music_SafariZone)
; ld [wAudioSavedROMBank], a
ld a, MUSIC_SAFARI_ZONE
; ld [wNewSoundID], a
call PlayMusic
ld [wMusicFadeID], a
; call PlayMusic
ld c, 100
call DelayFrames
call ClearScreen
@ -916,12 +916,13 @@ CableClub_Run:
ld [wLinkState], a
ldh [hJoy5], a
ld a, 10
ld [wAudioFadeOutControl], a
ld [wMusicFade], a
; ld a, 0 ; BANK(Music_Celadon)
; ld [wAudioSavedROMBank], a
ld a, MUSIC_CELADON
; ld [wNewSoundID], a
jp PlayMusic
ld [wMusicFadeID], a
; jp PlayMusic
ret
EmptyFunc:
ret

View file

@ -281,8 +281,7 @@ HoFRecordMonInfo:
HoFFadeOutScreenAndMusic:
ld a, 10
ld [wAudioFadeOutCounterReloadValue], a
ld [wAudioFadeOutCounter], a
ld a, $ff
ld [wAudioFadeOutControl], a
ld [wMusicFade], a
xor a
ld [wMusicFadeID], a
jp GBFadeOutToWhite

View file

@ -133,12 +133,9 @@ OakSpeech:
; ld [wAudioSavedROMBank], a
ld a, 10
call StopMusic
; ld a, 10
; ld [wAudioFadeOutControl], a
; ld a, SFX_STOP_ALL_MUSIC
; ld [wNewSoundID], a
; call PlaySound
ld [wMusicFade], a
xor a
ld [wMusicFadeID], a
pop af
ldh [hLoadedROMBank], a

View file

@ -17,17 +17,13 @@ AnimateHealingMachine:
call CopyHealingMachineOAM
ld a, 4
call StopMusic
call WaitForSongToFinish
; ld a, 4
; ld [wAudioFadeOutControl], a
; ld a, SFX_STOP_ALL_MUSIC
; ld [wNewSoundID], a
; call PlaySound
;.waitLoop
; ld a, [wAudioFadeOutControl]
; and a ; is fade-out finished?
; jr nz, .waitLoop ; if not, check again
ld [wMusicFade], a
xor a
ld [wMusicFadeID], a
.waitLoop
ld a, [wMusicFade]
and a ; is fade-out finished?
jr nz, .waitLoop ; if not, check again
ld a, [wPartyCount]
ld b, a

View file

@ -122,7 +122,6 @@ _LeaveMapAnim::
.playerNotStandingOnWarpPadOrHole
ld a, $4
call StopMusic
call WaitForSongToFinish
ld a, [wd732]
bit 6, a ; is the last used pokemon center the destination?
jr z, .flyAnimation

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)