Name cry functions in home.asm.

This commit is contained in:
yenatch 2014-07-18 10:25:03 -07:00
parent 251517812f
commit 928cdcfc23
8 changed files with 69 additions and 56 deletions

View File

@ -1317,7 +1317,7 @@ BattleAnimCmd_E1: ; cc807 (33:4807)
.asm_cc834
push hl
call Function37f3
call LoadCryHeader
pop hl
jr c, .done

View File

@ -2350,7 +2350,7 @@ Function3cef1: ; 3cef1
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 @@ Function3d7c7: ; 3d7c7
ld a, $f
ld [CryTracks], a
ld a, [TempEnemyMonSpecies]
call Function37b6
call PlayStereoCry
.asm_3d82c
call UpdateEnemyHUD
@ -4235,7 +4235,7 @@ Function3db5f: ; 3db5f
ld a, $f0
ld [CryTracks], a
ld a, [CurPartySpecies]
call Function37b6
call PlayStereoCry
.asm_3dbd6
call UpdatePlayerHUD
@ -4368,7 +4368,7 @@ Function3dc5b: ; 3dc5b
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 @@ BattleStartMessage: ; 3fc8b
ld a, $0f
ld [CryTracks], a
ld a, [TempEnemyMonSpecies]
call Function37b6
call PlayStereoCry
.asm_3fceb
ld a, [BattleType]

View File

@ -1040,10 +1040,10 @@ Script_cry: ; 0x971d1
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

View File

@ -180,7 +180,7 @@ Functiond0171: ; d0171
Functiond017a: ; d017a
ld a, [$d16b]
call Function37e2
call _PlayCry
ld a, [$d168]
inc a
ld [$d168], a
@ -189,7 +189,7 @@ Functiond017a: ; d017a
Functiond0188: ; d0188
ld a, [$d16b]
call Function37d5
call PlayCry2
ld a, [$d168]
inc a
ld [$d168], a
@ -200,7 +200,7 @@ Functiond0196: ; d0196
ld a, $f
ld [CryTracks], a
ld a, [$d16b]
call Function37c4
call PlayStereoCry2
ld a, [$d168]
inc a
ld [$d168], a

View File

@ -1718,61 +1718,69 @@ Function378b:: ; 378b
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
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 @@ Function37f3:: ; 37f3
inc hl
ld d, [hl]
inc hl
ld a, [hli]
ld [CryPitch], a
ld a, [hli]
@ -1805,11 +1814,11 @@ Function37f3:: ; 37f3
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 @@ Function381e:: ; 381e
and a
ret
.asm_382b
.no
scf
ret
; 382d

View File

@ -142,7 +142,7 @@ PlayMusic2:: ; 3bbc
PlayCryHeader:: ; 3be3
; Play a cry given parameters at header de
; Play cry header de.
push hl
push de

View File

@ -1108,7 +1108,7 @@ Function1522:: ; 1522
ld e, [hl]
inc hl
ld d, [hl]
call Function37ce
call PlayCry
pop de
pop hl
pop bc

View File

@ -4487,7 +4487,7 @@ OakText2: ; 0x604a
TX_FAR _OakText2
start_asm
ld a,WOOPER
call Function37ce
call PlayCry
call WaitSFX
ld hl,OakText3
ret
@ -8443,7 +8443,7 @@ SpecialSnorlaxAwake: ; 0xc43d
Functionc472: ; c472
ld a, [CurPartySpecies]
jp Function37ce
jp PlayCry
; c478
SpecialGameboyCheck: ; c478
@ -28842,7 +28842,7 @@ Function167f6: ; 167f6
ld a, $5
call Function1689b
ld a, [CurPartySpecies]
call Function37ce
call PlayCry
ld a, $9
call Function1689b
ret
@ -28902,7 +28902,7 @@ Function16850: ; 16850
ld a, $d
call Function1689b
ld a, [CurPartySpecies]
call Function37ce
call PlayCry
ld a, $e
call Function1689b
ret
@ -30624,7 +30624,7 @@ Function17421: ; 17421
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 @@ Function17440: ; 17440
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 @@ Function2942e: ; 2942e
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 @@ Function40217: ; 40217 (10:4217)
ld a, $4
call Function41423
ld a, [CurPartySpecies] ; $d108
call Function37ce
call PlayCry
call Function40131
ret
@ -44370,7 +44371,7 @@ Function402aa: ; 402aa (10:42aa)
ld a, $4
call Function41423
ld a, [CurPartySpecies] ; $d108
call Function37ce
call PlayCry
ld hl, $cf63
dec [hl]
ret
@ -44426,7 +44427,7 @@ Function402fa: ; 402fa
Function40340: ; 40340
call Function40bb1
ld a, [$d265]
call Function381e
call GetCryIndex
ld e, c
ld d, b
call PlayCryHeader
@ -46626,7 +46627,7 @@ Function41a7f: ; 41a7f
ld a, $4
call Function41423
ld a, [CurPartySpecies]
call Function37ce
call PlayCry
ret
; 41ad7
@ -56942,7 +56943,7 @@ Function4e226: ; 4e226 (13:6226)
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 @@ _EvolutionAnimation: ; 4e607
jr c, .asm_4e67c
ld a, [Buffer1]
call Function37ce
call PlayCry
.asm_4e67c
ld de, MUSIC_EVOLUTION
@ -57538,7 +57539,7 @@ _EvolutionAnimation: ; 4e607
ret c
ld a, [PlayerHPPal]
call Function37ce
call PlayCry
ret
; 4e703
@ -95608,7 +95609,7 @@ Functione307c: ; e307c (38:707c)
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 @@ Functione30fa: ; e30fa (38:70fa)
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 @@ Functione3180: ; e3180 (38:7180)
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 @@ INCLUDE "event/name_rater.asm"
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 @@ Functionfb841: ; fb841
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 @@ Functionfb841: ; fb841
callba _PlayCryHeader
call WaitSFX
.asm_fb876
.done
ret
; fb877