aboutsummaryrefslogtreecommitdiff
path: root/src-z80/player/misc.z80
diff options
context:
space:
mode:
Diffstat (limited to 'src-z80/player/misc.z80')
-rw-r--r--src-z80/player/misc.z8055
1 files changed, 55 insertions, 0 deletions
diff --git a/src-z80/player/misc.z80 b/src-z80/player/misc.z80
index dee980e..56e11b4 100644
--- a/src-z80/player/misc.z80
+++ b/src-z80/player/misc.z80
@@ -1,6 +1,8 @@
;****************************************************************************
; SetDelay* [event $FE, events $D0-$DF]
; Adds a delay in playback
+;----------------------------------------------------------------------------
+; breaks: c, de, hl
;****************************************************************************
SetDelaySFX:
@@ -46,6 +48,58 @@ SetDelayShort:
ret ; End of subroutine
;****************************************************************************
+; SetFlags [event $FA]
+; Sets some of the flags.
+;----------------------------------------------------------------------------
+; breaks: c, de, hl
+;****************************************************************************
+
+SetFlagsSFX:
+ call SetFlags
+ jp ProcessSFXRun
+
+SetFlagsBGM:
+ call SetFlags
+ jp ProcessBGMRun
+
+SetFlags:
+ PollPCM ; Get which flags to set
+ call GetParam
+ PollPCM
+
+ ld a, (RAM_Flags) ; Set the flags
+ or b
+ ld (RAM_Flags), a
+
+ ret ; End of subroutine
+
+;****************************************************************************
+; ClearFlags [event $FB]
+; Clears some of the flags.
+;----------------------------------------------------------------------------
+; breaks: c, de, hl
+;****************************************************************************
+
+ClearFlagsSFX:
+ call ClearFlags
+ jp ProcessSFXRun
+
+ClearFlagsBGM:
+ call ClearFlags
+ jp ProcessBGMRun
+
+ClearFlags:
+ PollPCM ; Get which flags to clear
+ call GetParam
+ PollPCM
+
+ ld a, (RAM_Flags) ; Clear the flags
+ and b
+ ld (RAM_Flags), a
+
+ ret ; End of subroutine
+
+;****************************************************************************
; RefreshVolume
; Reloads the volume for all channels.
;----------------------------------------------------------------------------
@@ -69,6 +123,7 @@ RefreshVolume:
inc l
inc e
dec c
+ PollPCM
jr nz, .fixfmvol
ld hl, $1FE8 ; Update PSG volume