Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/home/delay.asm
1270 views
1
DelayFrames::
2
; wait c frames
3
call DelayFrame
4
dec c
5
jr nz, DelayFrames
6
ret
7
8
PlaySoundWaitForCurrent::
9
push af
10
call WaitForSoundToFinish
11
pop af
12
jp PlaySound
13
14
; Wait for sound to finish playing
15
WaitForSoundToFinish::
16
ld a, [wLowHealthAlarm]
17
and $80
18
ret nz
19
push hl
20
.waitLoop
21
ld hl, wChannelSoundIDs + CHAN5
22
xor a
23
or [hl]
24
inc hl
25
or [hl]
26
inc hl
27
inc hl
28
or [hl]
29
jr nz, .waitLoop
30
pop hl
31
ret
32
33