aboutsummaryrefslogtreecommitdiff
path: root/src-z80/core/direct.z80
blob: d796ddfa84b2f87dad87efe920ad260cbbe773b4 (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
;****************************************************************************
; ProcessDirect
; Processes the direct event stream.
;----------------------------------------------------------------------------
; breaks: all
;****************************************************************************

ProcessDirect:
    ld a, ($1F00)                       ; Are there even events to process?
    inc a
    ret z
    
    PollPCM
    
    ld hl, ProcessDirectEnd             ; Override $FF event
    ld (ProcessBGMEventFF+1), hl
    
    ld hl, $1F00                        ; Where event data is stored
    ld a, (RAM_LastBank)                ; To avoid wasting time with bank
    ld c, a                               ; switching
    
    jp ProcessBGMRun                    ; Start processing the event

ProcessDirectEnd:
    ld hl, StopBGMEvent                 ; Restore $FF event
    ld (ProcessBGMEventFF+1), hl
    ld a, $FF                           ; Reset the stream
    ld ($1F00), a
    
    ret                                 ; Return to the main loop