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 .asm_cc834
push hl push hl
call Function37f3 call LoadCryHeader
pop hl pop hl
jr c, .done jr c, .done

View File

@ -2350,7 +2350,7 @@ Function3cef1: ; 3cef1
ld a, $f0 ld a, $f0
ld [CryTracks], a ld [CryTracks], a
ld a, [BattleMonSpecies] ld a, [BattleMonSpecies]
call Function37b6 call PlayStereoCry
call Function3d43b call Function3d43b
hlcoord 9, 7 hlcoord 9, 7
lb bc, 5, 11 lb bc, 5, 11
@ -3741,7 +3741,7 @@ Function3d7c7: ; 3d7c7
ld a, $f ld a, $f
ld [CryTracks], a ld [CryTracks], a
ld a, [TempEnemyMonSpecies] ld a, [TempEnemyMonSpecies]
call Function37b6 call PlayStereoCry
.asm_3d82c .asm_3d82c
call UpdateEnemyHUD call UpdateEnemyHUD
@ -4235,7 +4235,7 @@ Function3db5f: ; 3db5f
ld a, $f0 ld a, $f0
ld [CryTracks], a ld [CryTracks], a
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
call Function37b6 call PlayStereoCry
.asm_3dbd6 .asm_3dbd6
call UpdatePlayerHUD call UpdatePlayerHUD
@ -4368,7 +4368,7 @@ Function3dc5b: ; 3dc5b
ld a, $f0 ld a, $f0
ld [CryTracks], a ld [CryTracks], a
ld a, [BattleMonSpecies] ld a, [BattleMonSpecies]
call Function37b6 call PlayStereoCry
ld a, [$c71a] ld a, [$c71a]
ld c, a ld c, a
ld hl, $c664 ld hl, $c664
@ -9490,7 +9490,7 @@ BattleStartMessage: ; 3fc8b
ld a, $0f ld a, $0f
ld [CryTracks], a ld [CryTracks], a
ld a, [TempEnemyMonSpecies] ld a, [TempEnemyMonSpecies]
call Function37b6 call PlayStereoCry
.asm_3fceb .asm_3fceb
ld a, [BattleType] ld a, [BattleType]

View File

@ -1040,10 +1040,10 @@ Script_cry: ; 0x971d1
call GetScriptByte call GetScriptByte
pop af pop af
and a and a
jr nz, .asm_971df ; 0x971da $3 jr nz, .ok
ld a, [ScriptVar] ld a, [ScriptVar]
.asm_971df .ok
call Function37ce call PlayCry
ret ret
; 0x971e3 ; 0x971e3

View File

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

View File

@ -1718,61 +1718,69 @@ Function378b:: ; 378b
ret ret
; 37b6 ; 37b6
Function37b6:: ; 37b6
PlayStereoCry:: ; 37b6
push af push af
ld a, $1 ld a, 1
ld [$c2bc], a ld [$c2bc], a
pop af pop af
call Function37e2 call _PlayCry
call WaitSFX call WaitSFX
ret ret
; 37c4 ; 37c4
Function37c4:: ; 37c4 PlayStereoCry2:: ; 37c4
; Don't wait for the cry to end.
; Used during pic animations.
push af push af
ld a, $1 ld a, 1
ld [$c2bc], a ld [$c2bc], a
pop af pop af
jp Function37e2 jp _PlayCry
; 37ce ; 37ce
Function37ce:: ; 37ce PlayCry:: ; 37ce
call Function37d5 call PlayCry2
call WaitSFX call WaitSFX
ret ret
; 37d5 ; 37d5
Function37d5:: ; 37d5 PlayCry2:: ; 37d5
; Don't wait for the cry to end.
push af push af
xor a xor a
ld [$c2bc], a ld [$c2bc], a
ld [CryTracks], a ld [CryTracks], a
pop af pop af
call Function37e2 call _PlayCry
ret ret
; 37e2 ; 37e2
Function37e2:: ; 37e2 _PlayCry:: ; 37e2
push hl push hl
push de push de
push bc push bc
call Function381e call GetCryIndex
jr c, .asm_37ef jr c, .done
ld e, c ld e, c
ld d, b ld d, b
call PlayCryHeader call PlayCryHeader
.asm_37ef
.done
pop bc pop bc
pop de pop de
pop hl pop hl
ret ret
; 37f3 ; 37f3
Function37f3:: ; 37f3 LoadCryHeader:: ; 37f3
call Function381e ; Load cry header bc.
call GetCryIndex
ret c ret c
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld a, BANK(CryHeaders) ld a, BANK(CryHeaders)
@ -1790,6 +1798,7 @@ Function37f3:: ; 37f3
inc hl inc hl
ld d, [hl] ld d, [hl]
inc hl inc hl
ld a, [hli] ld a, [hli]
ld [CryPitch], a ld [CryPitch], a
ld a, [hli] ld a, [hli]
@ -1805,11 +1814,11 @@ Function37f3:: ; 37f3
ret ret
; 381e ; 381e
Function381e:: ; 381e GetCryIndex:: ; 381e
and a and a
jr z, .asm_382b jr z, .no
cp NUM_POKEMON + 1 cp NUM_POKEMON + 1
jr nc, .asm_382b jr nc, .no
dec a dec a
ld c, a ld c, a
@ -1817,7 +1826,7 @@ Function381e:: ; 381e
and a and a
ret ret
.asm_382b .no
scf scf
ret ret
; 382d ; 382d

View File

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

View File

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

View File

@ -4487,7 +4487,7 @@ OakText2: ; 0x604a
TX_FAR _OakText2 TX_FAR _OakText2
start_asm start_asm
ld a,WOOPER ld a,WOOPER
call Function37ce call PlayCry
call WaitSFX call WaitSFX
ld hl,OakText3 ld hl,OakText3
ret ret
@ -8443,7 +8443,7 @@ SpecialSnorlaxAwake: ; 0xc43d
Functionc472: ; c472 Functionc472: ; c472
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
jp Function37ce jp PlayCry
; c478 ; c478
SpecialGameboyCheck: ; c478 SpecialGameboyCheck: ; c478
@ -28842,7 +28842,7 @@ Function167f6: ; 167f6
ld a, $5 ld a, $5
call Function1689b call Function1689b
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
call Function37ce call PlayCry
ld a, $9 ld a, $9
call Function1689b call Function1689b
ret ret
@ -28902,7 +28902,7 @@ Function16850: ; 16850
ld a, $d ld a, $d
call Function1689b call Function1689b
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
call Function37ce call PlayCry
ld a, $e ld a, $e
call Function1689b call Function1689b
ret ret
@ -30624,7 +30624,7 @@ Function17421: ; 17421
ld hl, UnknownText_0x17467 ld hl, UnknownText_0x17467
call PrintText call PrintText
ld a, [wBreedMon1Species] ld a, [wBreedMon1Species]
call Function37ce call PlayCry
ld a, [wDaycareLady] ld a, [wDaycareLady]
bit 0, a bit 0, a
jr z, Function1745f jr z, Function1745f
@ -30637,7 +30637,7 @@ Function17440: ; 17440
ld hl, UnknownText_0x17462 ld hl, UnknownText_0x17462
call PrintText call PrintText
ld a, [wBreedMon2Species] ld a, [wBreedMon2Species]
call Function37ce call PlayCry
ld a, [wDaycareMan] ld a, [wDaycareMan]
bit 0, a bit 0, a
jr z, Function1745f jr z, Function1745f
@ -39022,14 +39022,15 @@ Function2942e: ; 2942e
ld a, $e4 ld a, $e4
call DmgToCgbBGPals call DmgToCgbBGPals
call Function294bb call Function294bb
ld a, [PlayerSDefLevel] ld a, [PlayerSDefLevel]
call Function381e call GetCryIndex
jr c, .asm_2945d jr c, .asm_2945d
ld e, c ld e, c
ld d, b ld d, b
call PlayCryHeader call PlayCryHeader
.asm_2945d .asm_2945d
call Function29114 call Function29114
ret ret
; 29461 ; 29461
@ -44298,7 +44299,7 @@ Function40217: ; 40217 (10:4217)
ld a, $4 ld a, $4
call Function41423 call Function41423
ld a, [CurPartySpecies] ; $d108 ld a, [CurPartySpecies] ; $d108
call Function37ce call PlayCry
call Function40131 call Function40131
ret ret
@ -44370,7 +44371,7 @@ Function402aa: ; 402aa (10:42aa)
ld a, $4 ld a, $4
call Function41423 call Function41423
ld a, [CurPartySpecies] ; $d108 ld a, [CurPartySpecies] ; $d108
call Function37ce call PlayCry
ld hl, $cf63 ld hl, $cf63
dec [hl] dec [hl]
ret ret
@ -44426,7 +44427,7 @@ Function402fa: ; 402fa
Function40340: ; 40340 Function40340: ; 40340
call Function40bb1 call Function40bb1
ld a, [$d265] ld a, [$d265]
call Function381e call GetCryIndex
ld e, c ld e, c
ld d, b ld d, b
call PlayCryHeader call PlayCryHeader
@ -46626,7 +46627,7 @@ Function41a7f: ; 41a7f
ld a, $4 ld a, $4
call Function41423 call Function41423
ld a, [CurPartySpecies] ld a, [CurPartySpecies]
call Function37ce call PlayCry
ret ret
; 41ad7 ; 41ad7
@ -56942,7 +56943,7 @@ Function4e226: ; 4e226 (13:6226)
call Function32f9 call Function32f9
call Function4e253 call Function4e253
ld a, [CurPartySpecies] ; $d108 ld a, [CurPartySpecies] ; $d108
call Function37d5 call PlayCry2
ret ret
; known jump sources: 4e23f (13:623f), 4e249 (13:6249) ; known jump sources: 4e23f (13:623f), 4e249 (13:6249)
@ -57469,7 +57470,7 @@ _EvolutionAnimation: ; 4e607
jr c, .asm_4e67c jr c, .asm_4e67c
ld a, [Buffer1] ld a, [Buffer1]
call Function37ce call PlayCry
.asm_4e67c .asm_4e67c
ld de, MUSIC_EVOLUTION ld de, MUSIC_EVOLUTION
@ -57538,7 +57539,7 @@ _EvolutionAnimation: ; 4e607
ret c ret c
ld a, [PlayerHPPal] ld a, [PlayerHPPal]
call Function37ce call PlayCry
ret ret
; 4e703 ; 4e703
@ -95608,7 +95609,7 @@ Functione307c: ; e307c (38:707c)
ld [$d10b], a ld [$d10b], a
callba Functione039 callba Functione039
ld a, [CurPartySpecies] ; $d108 ld a, [CurPartySpecies] ; $d108
call Function37ce call PlayCry
ld hl, TileMap ; $c4a0 (aliases: SpritesEnd) ld hl, TileMap ; $c4a0 (aliases: SpritesEnd)
ld bc, $f08 ld bc, $f08
call ClearBox call ClearBox
@ -95663,7 +95664,7 @@ Functione30fa: ; e30fa (38:70fa)
ld [$d10b], a ld [$d10b], a
callba Functione039 callba Functione039
ld a, [CurPartySpecies] ; $d108 ld a, [CurPartySpecies] ; $d108
call Function37ce call PlayCry
ld hl, TileMap ; $c4a0 (aliases: SpritesEnd) ld hl, TileMap ; $c4a0 (aliases: SpritesEnd)
ld bc, $f08 ld bc, $f08
call ClearBox call ClearBox
@ -95709,14 +95710,16 @@ Functione3180: ; e3180 (38:7180)
hlcoord 0, 15 hlcoord 0, 15
ld bc, $112 ld bc, $112
call TextBox call TextBox
call WaitBGMap call WaitBGMap
ld a, [CurPartySpecies] ; $d108 ld a, [CurPartySpecies] ; $d108
call Function381e call GetCryIndex
jr c, .asm_e31ab jr c, .asm_e31ab
ld e, c ld e, c
ld d, b ld d, b
call PlayCryHeader call PlayCryHeader
.asm_e31ab .asm_e31ab
ld a, [CurPartySpecies] ; $d108 ld a, [CurPartySpecies] ; $d108
ld [$d265], a ld [$d265], a
call GetPokemonName call GetPokemonName
@ -99726,8 +99729,9 @@ INCLUDE "event/name_rater.asm"
Functionfb841: ; fb841 Functionfb841: ; fb841
ld a, [ScriptVar] ld a, [ScriptVar]
call Function37f3 call LoadCryHeader
jr c, .asm_fb876 jr c, .done
ld hl, CryPitch ld hl, CryPitch
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
@ -99742,7 +99746,7 @@ Functionfb841: ; fb841
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld bc, $0060 ld bc, $60
add hl, bc add hl, bc
ld a, l ld a, l
ld [CryLength], a ld [CryLength], a
@ -99751,7 +99755,7 @@ Functionfb841: ; fb841
callba _PlayCryHeader callba _PlayCryHeader
call WaitSFX call WaitSFX
.asm_fb876 .done
ret ret
; fb877 ; fb877