From 84ca3186406f65f65a18b18130dcecab2c78e2d3 Mon Sep 17 00:00:00 2001 From: Javier Degirolmo Date: Wed, 7 Dec 2011 19:58:15 -0300 Subject: Some updates... Trying to fix SFX restoring but still broken --- src-z80/core/bgm.z80 | 14 ++++++++++++-- src-z80/core/main.z80 | 2 +- src-z80/core/sfx.z80 | 5 +---- 3 files changed, 14 insertions(+), 7 deletions(-) (limited to 'src-z80/core') diff --git a/src-z80/core/bgm.z80 b/src-z80/core/bgm.z80 index c1650f1..ebda240 100644 --- a/src-z80/core/bgm.z80 +++ b/src-z80/core/bgm.z80 @@ -41,8 +41,17 @@ PlayBGM: ld hl, ProcessBGM ; Tell Echo to process BGM ld (DoTick_BGM+1), hl + + ld b, 8 ; Kill all FM channels explicitly +.resetallfm: + ld a, b + and $04 + rrca + ld iyl, a + ld a, b + call KillFM + djnz .resetallfm - PollPCM jp IdleLoop ; End of subroutine ;**************************************************************************** @@ -244,7 +253,8 @@ ClearBGM: .resetfm: PollPCM - xor a ; Reset BGM volume + ;xor a ; Reset BGM volume + ld a, $7F ld (de), a dec e diff --git a/src-z80/core/main.z80 b/src-z80/core/main.z80 index 9ac1aa4..bc63da9 100644 --- a/src-z80/core/main.z80 +++ b/src-z80/core/main.z80 @@ -90,7 +90,7 @@ EntryPoint: ld (ix+1), $C9 ld (ix+0), $27 ld (ix+1), $3F - + jp IdleLoop ; Go into idle loop ;**************************************************************************** diff --git a/src-z80/core/sfx.z80 b/src-z80/core/sfx.z80 index f32a8f0..6a553bb 100644 --- a/src-z80/core/sfx.z80 +++ b/src-z80/core/sfx.z80 @@ -284,13 +284,9 @@ ClearSFX: ld l, a push bc - push de - push hl ld a, b ld b, (hl) call LoadFMDirect - pop hl - pop de pop bc PollPCM @@ -298,6 +294,7 @@ ClearSFX: ld a, b ; Restore BGM FM volume add RAM_BGMFMVol&$FF ld l, a + ld a, b ld b, (hl) call SetFMVolLoad -- cgit v1.2.3