aboutsummaryrefslogtreecommitdiff
path: root/src-z80/player/misc.z80
blob: 36be2505e4c8ade30527719e5829caa3c15a92b6 (plain)
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
;****************************************************************************
; SetDelay* [event $FE, events $D0-$DF]
; Adds a delay in playback
;****************************************************************************

SetDelaySFX:
    call SetDelay               ; We're just a wrapper
    jp DoTick_SFXSkip           ; End of subroutine

SetDelayBGM:
    call SetDelay               ; We're just a wrapper
    jp DoTick_BGMSkip           ; End of subroutine

SetDelaySFXShort:
    and $0F
    inc a
    ld b, a
    call SetDelayShort          ; We're just a wrapper
    jp DoTick_SFXSkip           ; End of subroutine

SetDelayBGMShort:
    and $0F
    inc a
    ld b, a
    call SetDelayShort          ; We're just a wrapper
    jp DoTick_BGMSkip           ; End of subroutine

SetDelay:
    PollPCM
    call GetParam               ; Get delay
    PollPCM

SetDelayShort:
    ex de, hl
    ld (hl), d                  ; Store new address
    dec l
    ld (hl), e
    dec l
    ld (hl), c

    PollPCM

    dec l                       ; Store new delay
    ld (hl), b

    ret                         ; End of subroutine