2014-07-18 17:26:15 +00:00
|
|
|
PlayStereoCry:: ; 37b6
|
|
|
|
push af
|
|
|
|
ld a, 1
|
2015-12-23 22:10:50 +00:00
|
|
|
ld [wStereoPanningMask], a
|
2014-07-18 17:26:15 +00:00
|
|
|
pop af
|
|
|
|
call _PlayCry
|
|
|
|
call WaitSFX
|
|
|
|
ret
|
|
|
|
; 37c4
|
|
|
|
|
|
|
|
PlayStereoCry2:: ; 37c4
|
|
|
|
; Don't wait for the cry to end.
|
|
|
|
; Used during pic animations.
|
|
|
|
push af
|
|
|
|
ld a, 1
|
2015-12-23 22:10:50 +00:00
|
|
|
ld [wStereoPanningMask], a
|
2014-07-18 17:26:15 +00:00
|
|
|
pop af
|
|
|
|
jp _PlayCry
|
|
|
|
; 37ce
|
|
|
|
|
|
|
|
PlayCry:: ; 37ce
|
|
|
|
call PlayCry2
|
|
|
|
call WaitSFX
|
|
|
|
ret
|
|
|
|
; 37d5
|
|
|
|
|
|
|
|
PlayCry2:: ; 37d5
|
|
|
|
; Don't wait for the cry to end.
|
|
|
|
push af
|
|
|
|
xor a
|
2015-12-23 22:10:50 +00:00
|
|
|
ld [wStereoPanningMask], a
|
2014-07-18 17:26:15 +00:00
|
|
|
ld [CryTracks], a
|
|
|
|
pop af
|
|
|
|
call _PlayCry
|
|
|
|
ret
|
|
|
|
; 37e2
|
|
|
|
|
|
|
|
_PlayCry:: ; 37e2
|
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
push bc
|
|
|
|
|
|
|
|
call GetCryIndex
|
|
|
|
jr c, .done
|
|
|
|
|
|
|
|
ld e, c
|
|
|
|
ld d, b
|
|
|
|
call PlayCryHeader
|
|
|
|
|
|
|
|
.done
|
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
; 37f3
|
|
|
|
|
|
|
|
LoadCryHeader:: ; 37f3
|
|
|
|
; Load cry header bc.
|
|
|
|
|
|
|
|
call GetCryIndex
|
|
|
|
ret c
|
|
|
|
|
|
|
|
ld a, [hROMBank]
|
|
|
|
push af
|
2017-12-26 17:50:32 +00:00
|
|
|
ld a, BANK(PokemonCries)
|
2014-07-18 17:26:15 +00:00
|
|
|
rst Bankswitch
|
|
|
|
|
2017-12-26 17:50:32 +00:00
|
|
|
ld hl, PokemonCries
|
|
|
|
rept 6 ; sizeof(mon_cry)
|
2014-07-18 17:26:15 +00:00
|
|
|
add hl, bc
|
2015-07-21 02:18:18 +00:00
|
|
|
endr
|
2014-07-18 17:26:15 +00:00
|
|
|
|
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
|
|
|
inc hl
|
|
|
|
|
|
|
|
ld a, [hli]
|
|
|
|
ld [CryPitch], a
|
|
|
|
ld a, [hli]
|
|
|
|
ld [CryPitch + 1], a
|
|
|
|
ld a, [hli]
|
|
|
|
ld [CryLength], a
|
|
|
|
ld a, [hl]
|
|
|
|
ld [CryLength + 1], a
|
|
|
|
|
|
|
|
pop af
|
|
|
|
rst Bankswitch
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
; 381e
|
|
|
|
|
|
|
|
GetCryIndex:: ; 381e
|
|
|
|
and a
|
|
|
|
jr z, .no
|
|
|
|
cp NUM_POKEMON + 1
|
|
|
|
jr nc, .no
|
|
|
|
|
|
|
|
dec a
|
|
|
|
ld c, a
|
|
|
|
ld b, 0
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.no
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; 382d
|