aboutsummaryrefslogtreecommitdiff
path: root/src-z80/player/fm.z80
diff options
context:
space:
mode:
authorJavier Degirolmo2011-12-09 08:29:41 -0300
committerJavier Degirolmo2011-12-09 08:29:41 -0300
commitf7ef91fd060eaa724bdb6940fd1b21dd08923837 (patch)
tree6eb32206d72aa7928a1c75bbdb1e0a322b5ce1a7 /src-z80/player/fm.z80
parent6446fde6c853329dd62621e5e82e868d7f132f00 (diff)
Fixed FM volume restoring bug (I hope?)
Diffstat (limited to 'src-z80/player/fm.z80')
-rw-r--r--src-z80/player/fm.z8021
1 files changed, 9 insertions, 12 deletions
diff --git a/src-z80/player/fm.z80 b/src-z80/player/fm.z80
index 96c9f4c..b48e79b 100644
--- a/src-z80/player/fm.z80
+++ b/src-z80/player/fm.z80
@@ -222,9 +222,8 @@ LoadFMBGM:
PollPCM
call GetParam
PollPCM
- ex de, hl
- ld (hl), b
- ex de, hl
+ ld a, b
+ ld (de), a
ld a, e ; Reset volume
add 8
@@ -240,9 +239,9 @@ LoadFMBGM:
PollPCM
push hl ; Check if channel is free
- ld hl, RAM_Locked
ld a, b
- add l
+ ld h, RAM_Locked>>8
+ add RAM_Locked&$FF
ld l, a
ld a, (hl)
pop hl
@@ -251,8 +250,7 @@ LoadFMBGM:
PollPCM
- ld a, b
- and $07
+ ld a, b ; Get back instrument ID
push hl
ld hl, RAM_BGMFMInstr
add l
@@ -260,9 +258,9 @@ LoadFMBGM:
ld b, (hl)
pop hl
- push af
+ ex af, af'
PollPCM
- pop af
+ ex af, af'
call LoadFMDirect ; We're just a wrapper
jp ProcessBGMRun ; End of subroutine
@@ -350,8 +348,7 @@ LoadFMDirect:
add $B0
ld hl, RAM_Scratch ; Get address of buffer with the instrument
- ; data
-
+ ; data
ex af, af'
PollPCM ; Write operator
ex af, af'
@@ -741,7 +738,7 @@ LockChannelFM:
rrca
ld iyl, a
- ld a, b ; Reset stereo
+ ld a, b ; Reset FM parameters
and $03
add a
add a