pokecrystal-board/home/cry.asm
Rangi 32ed487a47 Merge branch 'master' of https://github.com/pret/pokecrystal
# Conflicts:
#	audio/engine.asm
#	constants/gfx_constants.asm
#	constants/map_data_constants.asm
#	constants/pokemon_data_constants.asm
#	constants/sprite_constants.asm
#	constants/wram_constants.asm
#	data/maps/data.asm
#	engine/battle/ai/scoring.asm
#	engine/battle/core.asm
#	engine/battle/effect_commands.asm
#	engine/battle/misc.asm
#	engine/battle_anims/getpokeballwobble.asm
#	engine/breeding.asm
#	engine/buy_sell_toss.asm
#	engine/decorations.asm
#	engine/events/battle_tower/battle_tower.asm
#	engine/events/battle_tower/rules.asm
#	engine/events/buena.asm
#	engine/events/bug_contest/contest_2.asm
#	engine/events/daycare.asm
#	engine/events/dratini.asm
#	engine/events/halloffame.asm
#	engine/events/happiness_egg.asm
#	engine/events/kurt.asm
#	engine/events/lucky_number.asm
#	engine/events/magnet_train.asm
#	engine/events/overworld.asm
#	engine/events/pokerus/pokerus.asm
#	engine/events/print_unown.asm
#	engine/events/print_unown_2.asm
#	engine/events/unown_walls.asm
#	engine/item_effects.asm
#	engine/link.asm
#	engine/mon_menu.asm
#	engine/player_object.asm
#	engine/routines/playslowcry.asm
#	engine/scripting.asm
#	engine/search.asm
#	engine/search2.asm
#	engine/specials.asm
#	engine/start_menu.asm
#	engine/timeset.asm
#	home/battle_vars.asm
#	home/map.asm
#	maps/GoldenrodUndergroundSwitchRoomEntrances.asm
#	maps/IlexForest.asm
#	maps/KrissHouse2F.asm
#	maps/Route39Barn.asm
#	mobile/mobile_12_2.asm
#	mobile/mobile_40.asm
#	mobile/mobile_5f.asm
#	wram.asm
2018-02-03 19:42:56 -05:00

109 lines
1.2 KiB
NASM

PlayStereoCry:: ; 37b6
push af
ld a, 1
ld [wStereoPanningMask], a
pop af
call _PlayMonCry
call WaitSFX
ret
; 37c4
PlayStereoCry2:: ; 37c4
; Don't wait for the cry to end.
; Used during pic animations.
push af
ld a, 1
ld [wStereoPanningMask], a
pop af
jp _PlayMonCry
; 37ce
PlayMonCry:: ; 37ce
call PlayMonCry2
call WaitSFX
ret
; 37d5
PlayMonCry2:: ; 37d5
; Don't wait for the cry to end.
push af
xor a
ld [wStereoPanningMask], a
ld [wCryTracks], a
pop af
call _PlayMonCry
ret
; 37e2
_PlayMonCry:: ; 37e2
push hl
push de
push bc
call GetCryIndex
jr c, .done
ld e, c
ld d, b
call PlayCry
.done
pop bc
pop de
pop hl
ret
; 37f3
LoadCry:: ; 37f3
; Load cry bc.
call GetCryIndex
ret c
ld a, [hROMBank]
push af
ld a, BANK(PokemonCries)
rst Bankswitch
ld hl, PokemonCries
rept 6 ; sizeof(mon_cry)
add hl, bc
endr
ld e, [hl]
inc hl
ld d, [hl]
inc hl
ld a, [hli]
ld [wCryPitch], a
ld a, [hli]
ld [wCryPitch + 1], a
ld a, [hli]
ld [wCryLength], a
ld a, [hl]
ld [wCryLength + 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