Insert Crystal audio engine and music

most credit goes to Sanqui
This commit is contained in:
dannye 2017-05-07 15:30:08 -05:00
parent 832c28eaea
commit 87eed68710
586 changed files with 193763 additions and 6447 deletions

View file

@ -1,4 +1,7 @@
AnimateHealingMachine:
xor a
call PlayMusic
ld de, PokeCenterFlashingMonitorAndHealBall
ld hl, vChars0 + $7c0
lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), $03 ; loads one too many tiles
@ -15,15 +18,17 @@ AnimateHealingMachine:
ld hl, wOAMBuffer + $84
ld de, PokeCenterOAMData
call CopyHealingMachineOAM
ld a, 4
ld [wAudioFadeOutControl], a
ld a, $ff
ld [wNewSoundID], a
call PlaySound
.waitLoop
ld a, [wAudioFadeOutControl]
and a ; is fade-out finished?
jr nz, .waitLoop ; if not, check again
; ld a, 4
; ld [wAudioFadeOutControl], a
; ld a, $ff
; ld [wNewSoundID], a
; call PlaySound
;.waitLoop
; ld a, [wAudioFadeOutControl]
; and a ; is fade-out finished?
; jr nz, .waitLoop ; if not, check again
ld a, [wPartyCount]
ld b, a
.partyLoop
@ -35,24 +40,25 @@ AnimateHealingMachine:
dec b
jr nz, .partyLoop
ld a, [wAudioROMBank]
cp BANK(Audio3_UpdateMusic)
cp $1f ; 0 ; BANK(Audio3_UpdateMusic) XXXXX
ld [wAudioSavedROMBank], a
jr nz, .next
ld a, $ff
ld [wNewSoundID], a
call PlaySound
ld a, BANK(Music_PkmnHealed)
ld a, 0 ; BANK(Music_PkmnHealed)
ld [wAudioROMBank], a
.next
ld a, MUSIC_PKMN_HEALED
ld [wNewSoundID], a
call PlaySound
call PlayMusic
ld d, $28
call FlashSprite8Times
.waitLoop2
ld a, [wChannelSoundIDs]
cp MUSIC_PKMN_HEALED ; is the healed music still playing?
jr z, .waitLoop2 ; if so, check gain
ld a, [Channel1MusicID]
and a
jr nz, .waitLoop2
ld c, 32
call DelayFrames
pop af
@ -60,6 +66,8 @@ AnimateHealingMachine:
pop hl
pop af
ld [hl], a
jp UpdateSprites
PokeCenterFlashingMonitorAndHealBall: