1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
PlayStereoCry:: ; 39f0 (0:39f0)
push af
ld a, $1
ld [wStereoPanningMask], a
pop af
jr _PlayMonCry
PlayMonCry:: ; 39f9 (0:39f9)
push af
xor a
ld [wStereoPanningMask], a
ld [wCryTracks], a
pop af
_PlayMonCry::
push hl
push de
push bc
call GetCryIndex
jr c, .asm_3a12
ld e, c
ld d, b
call PlayCry
call WaitSFX
.asm_3a12
pop bc
pop de
pop hl
ret
LoadCryHeader::
call GetCryIndex
ret c
ld a, [hROMBank]
push af
ld a, $3c
rst Bankswitch
ld hl, $6747
add hl, bc
add hl, bc
add hl, bc
add hl, bc
add hl, bc
add hl, bc
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
GetCryIndex:: ; 3a41 (0:3a41)
and a
jr z, .asm_3a4e
cp NUM_POKEMON + 1
jr nc, .asm_3a4e
dec a
ld c, a
ld b, $0
and a
ret
.asm_3a4e
scf
ret
|