2018-06-24 14:09:41 +00:00
|
|
|
PlayStereoCry::
|
2014-07-18 17:26:15 +00:00
|
|
|
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
|
2018-01-17 04:47:45 +00:00
|
|
|
call _PlayMonCry
|
2014-07-18 17:26:15 +00:00
|
|
|
call WaitSFX
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
PlayStereoCry2::
|
2014-07-18 17:26:15 +00:00
|
|
|
; 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
|
2018-01-17 04:47:45 +00:00
|
|
|
jp _PlayMonCry
|
2014-07-18 17:26:15 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
PlayMonCry::
|
2018-01-17 04:47:45 +00:00
|
|
|
call PlayMonCry2
|
2014-07-18 17:26:15 +00:00
|
|
|
call WaitSFX
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
PlayMonCry2::
|
2014-07-18 17:26:15 +00:00
|
|
|
; Don't wait for the cry to end.
|
|
|
|
push af
|
|
|
|
xor a
|
2015-12-23 22:10:50 +00:00
|
|
|
ld [wStereoPanningMask], a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCryTracks], a
|
2014-07-18 17:26:15 +00:00
|
|
|
pop af
|
2018-01-17 04:47:45 +00:00
|
|
|
call _PlayMonCry
|
2014-07-18 17:26:15 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
_PlayMonCry::
|
2014-07-18 17:26:15 +00:00
|
|
|
push hl
|
|
|
|
push de
|
|
|
|
push bc
|
|
|
|
|
|
|
|
call GetCryIndex
|
|
|
|
jr c, .done
|
|
|
|
|
|
|
|
ld e, c
|
|
|
|
ld d, b
|
2018-01-17 04:47:45 +00:00
|
|
|
call PlayCry
|
2014-07-18 17:26:15 +00:00
|
|
|
|
|
|
|
.done
|
|
|
|
pop bc
|
|
|
|
pop de
|
|
|
|
pop hl
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
LoadCry::
|
2018-01-23 16:17:21 +00:00
|
|
|
; Load cry bc.
|
2014-07-18 17:26:15 +00:00
|
|
|
|
|
|
|
call GetCryIndex
|
|
|
|
ret c
|
|
|
|
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hROMBank]
|
2014-07-18 17:26:15 +00:00
|
|
|
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]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCryPitch], a
|
2014-07-18 17:26:15 +00:00
|
|
|
ld a, [hli]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCryPitch + 1], a
|
2014-07-18 17:26:15 +00:00
|
|
|
ld a, [hli]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCryLength], a
|
2014-07-18 17:26:15 +00:00
|
|
|
ld a, [hl]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCryLength + 1], a
|
2014-07-18 17:26:15 +00:00
|
|
|
|
|
|
|
pop af
|
|
|
|
rst Bankswitch
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
GetCryIndex::
|
2014-07-18 17:26:15 +00:00
|
|
|
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
|