aboutsummaryrefslogtreecommitdiff
path: root/src-68k/sound
diff options
context:
space:
mode:
authorJavier Degirolmo2012-07-15 21:02:54 -0300
committerJavier Degirolmo2012-07-15 21:02:54 -0300
commitc7cf8a2eb4178f59a5dfe2c3ad6bf1a39eeca523 (patch)
treeddaf8602e1d089644753d6e0a52421f35b730b10 /src-68k/sound
parent84ce0220dd5449587467c37d7afbd99fb1fbe69e (diff)
Added BGM pausing support (stop BGM to pause, resume BGM to unpause)
Diffstat (limited to 'src-68k/sound')
-rw-r--r--src-68k/sound/echo.68k22
1 files changed, 20 insertions, 2 deletions
diff --git a/src-68k/sound/echo.68k b/src-68k/sound/echo.68k
index 73eb82f..1d02800 100644
--- a/src-68k/sound/echo.68k
+++ b/src-68k/sound/echo.68k
@@ -209,17 +209,35 @@ Echo_StopBGM:
rts ; End of subroutine
;****************************************************************************
+; Echo_ResumeBGM
+; Resumes BGM playback
+;****************************************************************************
+
+Echo_ResumeBGM:
+ move.w d0, -(sp) ; Save register
+ move.b #$06, d0 ; Command $06 = resume BGM
+ bsr Echo_SendCommand ; Send command to Echo
+ move.w (sp)+, d0 ; Restore register
+ rts ; End of subroutine
+
+;****************************************************************************
; Echo_GetStatus
; Gets the current status of Echo
;
-; output d0.b ... Echo status
+; output d0.w ... Echo status
; Bit #0: SFX is playing
; Bit #1: BGM is playing
+; Bit #15: command still not parsed
;****************************************************************************
Echo_GetStatus:
+ moveq #0, d0
Echo_Z80Request ; We need the Z80 bus
- move.b ($A01FF0), d0 ; Just get the status
+ move.b ($A01FF0), d0 ; Get the status flags
+ tst.b ($A01FFF) ; Check if command still has to be parsed
+ beq.s @NotBusy ; Any commands left to be parsed?
+ bset.l #15, d0 ; If so, set the relevant flag
+@NotBusy:
Echo_Z80Release ; Let the Z80 go!
rts ; End of subroutine