aboutsummaryrefslogtreecommitdiff
path: root/src-z80/core
diff options
context:
space:
mode:
Diffstat (limited to 'src-z80/core')
-rw-r--r--src-z80/core/bgm.z8018
-rw-r--r--src-z80/core/main.z801
-rw-r--r--src-z80/core/vars.z802
3 files changed, 19 insertions, 2 deletions
diff --git a/src-z80/core/bgm.z80 b/src-z80/core/bgm.z80
index cb8439a..ddb9f74 100644
--- a/src-z80/core/bgm.z80
+++ b/src-z80/core/bgm.z80
@@ -45,6 +45,14 @@ PlayBGM:
ld hl, ProcessBGM ; Tell Echo to process BGM
ld (DoTick_BGM+1), hl
+ ld b, 8 ; Force BGM volume of all FM channels to $00
+ ld c, 0 ; (default value for older Echo versions)
+ ld hl, RAM_BGMFMVol
+.playunmute:
+ ld (hl), c
+ inc l
+ djnz .playunmute
+
jp EndOfCommand ; End of subroutine
;****************************************************************************
@@ -311,7 +319,15 @@ StopBGM:
ld (RAM_BGMPlaying), a
ld hl, DoTick_BGMSkip
ld (DoTick_BGM+1), hl
-
+
+ ld b, 8 ; Force BGM volume of all FM channels to $7F
+ ld c, $7F
+ ld hl, RAM_BGMFMVol
+.stopmute:
+ ld (hl), c
+ inc l
+ djnz .stopmute
+
ret ; End of subroutine
;****************************************************************************
diff --git a/src-z80/core/main.z80 b/src-z80/core/main.z80
index 28758eb..383a0be 100644
--- a/src-z80/core/main.z80
+++ b/src-z80/core/main.z80
@@ -178,6 +178,7 @@ DoTick:
ld (ix+0), $27 ; Retrigger the timer
ld (ix+1), $2F
+DoTick_Tick:
PollPCM
diff --git a/src-z80/core/vars.z80 b/src-z80/core/vars.z80
index 321d552..23b15b5 100644
--- a/src-z80/core/vars.z80
+++ b/src-z80/core/vars.z80
@@ -14,7 +14,7 @@ RAM_PSGData: ds 4*16 ; PSG envelope data
; ds 1 ... BGM channel volume
RAM_BGMFMInstr: ds 8 ; FM instruments used by BGM
-RAM_BGMFMVol: ds 8 ; FM volumes used by BGM
+RAM_BGMFMVol: ds 8, $7F ; FM volumes used by BGM
RAM_BGMFMPan: ds 8, $C0 ; FM panning used by BGM
RAM_FMVol: ds 8 ; FM volume of each channel