From 3aacf3d2cedfdeca49ceb57533389870bfc688a9 Mon Sep 17 00:00:00 2001 From: sik Date: Sun, 23 Jul 2017 03:20:35 -0300 Subject: Now with pausing and other niceties --- src-z80/player/misc.z80 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'src-z80/player/misc.z80') 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: @@ -45,6 +47,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 -- cgit v1.2.3