ref: 928cdcfc23e90d2fb6a99aac7a7b7a4184dd77ed
parent: 251517812f65ab95c886e2cb9afe4b996e463ec7
author: yenatch <[email protected]>
date: Fri Jul 18 06:25:03 EDT 2014
Name cry functions in home.asm.
--- a/battle/anim_commands.asm
+++ b/battle/anim_commands.asm
@@ -1317,7 +1317,7 @@
.asm_cc834
push hl
- call Function37f3
+ call LoadCryHeader
pop hl
jr c, .done
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -2350,7 +2350,7 @@
ld a, $f0
ld [CryTracks], a
ld a, [BattleMonSpecies]
- call Function37b6
+ call PlayStereoCry
call Function3d43b
hlcoord 9, 7
lb bc, 5, 11
@@ -3741,7 +3741,7 @@
ld a, $f
ld [CryTracks], a
ld a, [TempEnemyMonSpecies]
- call Function37b6
+ call PlayStereoCry
.asm_3d82c
call UpdateEnemyHUD
@@ -4235,7 +4235,7 @@
ld a, $f0
ld [CryTracks], a
ld a, [CurPartySpecies]
- call Function37b6
+ call PlayStereoCry
.asm_3dbd6
call UpdatePlayerHUD
@@ -4368,7 +4368,7 @@
ld a, $f0
ld [CryTracks], a
ld a, [BattleMonSpecies]
- call Function37b6
+ call PlayStereoCry
ld a, [$c71a]
ld c, a
ld hl, $c664
@@ -9490,7 +9490,7 @@
ld a, $0f
ld [CryTracks], a
ld a, [TempEnemyMonSpecies]
- call Function37b6
+ call PlayStereoCry
.asm_3fceb
ld a, [BattleType]
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -1040,10 +1040,10 @@
call GetScriptByte
pop af
and a
- jr nz, .asm_971df ; 0x971da $3
+ jr nz, .ok
ld a, [ScriptVar]
-.asm_971df
- call Function37ce
+.ok
+ call PlayCry
ret
; 0x971e3
--- a/gfx/pics/animation.asm
+++ b/gfx/pics/animation.asm
@@ -180,7 +180,7 @@
Functiond017a: ; d017a
ld a, [$d16b]
- call Function37e2
+ call _PlayCry
ld a, [$d168]
inc a
ld [$d168], a
@@ -189,7 +189,7 @@
Functiond0188: ; d0188
ld a, [$d16b]
- call Function37d5
+ call PlayCry2
ld a, [$d168]
inc a
ld [$d168], a
@@ -200,7 +200,7 @@
ld a, $f
ld [CryTracks], a
ld a, [$d16b]
- call Function37c4
+ call PlayStereoCry2
ld a, [$d168]
inc a
ld [$d168], a
--- a/home.asm
+++ b/home.asm
@@ -1718,52 +1718,57 @@
ret
; 37b6
-Function37b6:: ; 37b6
+
+PlayStereoCry:: ; 37b6
push af
- ld a, $1
+ ld a, 1
ld [$c2bc], a
pop af
- call Function37e2
+ call _PlayCry
call WaitSFX
ret
; 37c4
-Function37c4:: ; 37c4
+PlayStereoCry2:: ; 37c4
+; Don't wait for the cry to end.
+; Used during pic animations.
push af
- ld a, $1
+ ld a, 1
ld [$c2bc], a
pop af
- jp Function37e2
+ jp _PlayCry
; 37ce
-Function37ce:: ; 37ce
- call Function37d5
+PlayCry:: ; 37ce
+ call PlayCry2
call WaitSFX
ret
; 37d5
-Function37d5:: ; 37d5
+PlayCry2:: ; 37d5
+; Don't wait for the cry to end.
push af
xor a
ld [$c2bc], a
ld [CryTracks], a
pop af
- call Function37e2
+ call _PlayCry
ret
; 37e2
-Function37e2:: ; 37e2
+_PlayCry:: ; 37e2
push hl
push de
push bc
- call Function381e
- jr c, .asm_37ef
+ call GetCryIndex
+ jr c, .done
+
ld e, c
ld d, b
call PlayCryHeader
-.asm_37ef
+.done
pop bc
pop de
pop hl
@@ -1770,9 +1775,12 @@
ret
; 37f3
-Function37f3:: ; 37f3
- call Function381e
+LoadCryHeader:: ; 37f3
+; Load cry header bc.
+
+ call GetCryIndex
ret c
+
ld a, [hROMBank]
push af
ld a, BANK(CryHeaders)
@@ -1790,6 +1798,7 @@
inc hl
ld d, [hl]
inc hl
+
ld a, [hli]
ld [CryPitch], a
ld a, [hli]
@@ -1805,11 +1814,11 @@
ret
; 381e
-Function381e:: ; 381e
+GetCryIndex:: ; 381e
and a
- jr z, .asm_382b
+ jr z, .no
cp NUM_POKEMON + 1
- jr nc, .asm_382b
+ jr nc, .no
dec a
ld c, a
@@ -1817,7 +1826,7 @@
and a
ret
-.asm_382b
+.no
scf
ret
; 382d
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -142,7 +142,7 @@
PlayCryHeader:: ; 3be3
-; Play a cry given parameters at header de
+; Play cry header de.
push hl
push de
--- a/home/text.asm
+++ b/home/text.asm
@@ -1108,7 +1108,7 @@
ld e, [hl]
inc hl
ld d, [hl]
- call Function37ce
+ call PlayCry
pop de
pop hl
pop bc
--- a/main.asm
+++ b/main.asm
@@ -4487,7 +4487,7 @@
TX_FAR _OakText2
start_asm
ld a,WOOPER
- call Function37ce
+ call PlayCry
call WaitSFX
ld hl,OakText3
ret
@@ -8443,7 +8443,7 @@
Functionc472: ; c472
ld a, [CurPartySpecies]
- jp Function37ce
+ jp PlayCry
; c478
SpecialGameboyCheck: ; c478
@@ -28842,7 +28842,7 @@
ld a, $5
call Function1689b
ld a, [CurPartySpecies]
- call Function37ce
+ call PlayCry
ld a, $9
call Function1689b
ret
@@ -28902,7 +28902,7 @@
ld a, $d
call Function1689b
ld a, [CurPartySpecies]
- call Function37ce
+ call PlayCry
ld a, $e
call Function1689b
ret
@@ -30624,7 +30624,7 @@
ld hl, UnknownText_0x17467
call PrintText
ld a, [wBreedMon1Species]
- call Function37ce
+ call PlayCry
ld a, [wDaycareLady]
bit 0, a
jr z, Function1745f
@@ -30637,7 +30637,7 @@
ld hl, UnknownText_0x17462
call PrintText
ld a, [wBreedMon2Species]
- call Function37ce
+ call PlayCry
ld a, [wDaycareMan]
bit 0, a
jr z, Function1745f
@@ -39022,14 +39022,15 @@
ld a, $e4
call DmgToCgbBGPals
call Function294bb
+
ld a, [PlayerSDefLevel]
- call Function381e
+ call GetCryIndex
jr c, .asm_2945d
ld e, c
ld d, b
call PlayCryHeader
-
.asm_2945d
+
call Function29114
ret
; 29461
@@ -44298,7 +44299,7 @@
ld a, $4
call Function41423
ld a, [CurPartySpecies] ; $d108
- call Function37ce
+ call PlayCry
call Function40131
ret
@@ -44370,7 +44371,7 @@
ld a, $4
call Function41423
ld a, [CurPartySpecies] ; $d108
- call Function37ce
+ call PlayCry
ld hl, $cf63
dec [hl]
ret
@@ -44426,7 +44427,7 @@
Function40340: ; 40340
call Function40bb1
ld a, [$d265]
- call Function381e
+ call GetCryIndex
ld e, c
ld d, b
call PlayCryHeader
@@ -46626,7 +46627,7 @@
ld a, $4
call Function41423
ld a, [CurPartySpecies]
- call Function37ce
+ call PlayCry
ret
; 41ad7
@@ -56942,7 +56943,7 @@
call Function32f9
call Function4e253
ld a, [CurPartySpecies] ; $d108
- call Function37d5
+ call PlayCry2
ret
; known jump sources: 4e23f (13:623f), 4e249 (13:6249)
@@ -57469,7 +57470,7 @@
jr c, .asm_4e67c
ld a, [Buffer1]
- call Function37ce
+ call PlayCry
.asm_4e67c
ld de, MUSIC_EVOLUTION
@@ -57538,7 +57539,7 @@
ret c
ld a, [PlayerHPPal]
- call Function37ce
+ call PlayCry
ret
; 4e703
@@ -95608,7 +95609,7 @@
ld [$d10b], a
callba Functione039
ld a, [CurPartySpecies] ; $d108
- call Function37ce
+ call PlayCry
ld hl, TileMap ; $c4a0 (aliases: SpritesEnd)
ld bc, $f08
call ClearBox
@@ -95663,7 +95664,7 @@
ld [$d10b], a
callba Functione039
ld a, [CurPartySpecies] ; $d108
- call Function37ce
+ call PlayCry
ld hl, TileMap ; $c4a0 (aliases: SpritesEnd)
ld bc, $f08
call ClearBox
@@ -95709,14 +95710,16 @@
hlcoord 0, 15
ld bc, $112
call TextBox
+
call WaitBGMap
ld a, [CurPartySpecies] ; $d108
- call Function381e
+ call GetCryIndex
jr c, .asm_e31ab
ld e, c
ld d, b
call PlayCryHeader
.asm_e31ab
+
ld a, [CurPartySpecies] ; $d108
ld [$d265], a
call GetPokemonName
@@ -99726,8 +99729,9 @@
Functionfb841: ; fb841
ld a, [ScriptVar]
- call Function37f3
- jr c, .asm_fb876
+ call LoadCryHeader
+ jr c, .done
+
ld hl, CryPitch
ld a, [hli]
ld h, [hl]
@@ -99742,7 +99746,7 @@
ld a, [hli]
ld h, [hl]
ld l, a
- ld bc, $0060
+ ld bc, $60
add hl, bc
ld a, l
ld [CryLength], a
@@ -99751,7 +99755,7 @@
callba _PlayCryHeader
call WaitSFX
-.asm_fb876
+.done
ret
; fb877