diff options
| author | Javier Degirolmo | 2012-04-29 15:57:47 -0300 |
|---|---|---|
| committer | Javier Degirolmo | 2012-04-29 15:57:47 -0300 |
| commit | 2902fc7a532edff250460bfbd8e7a31eedaa980b (patch) | |
| tree | 6b5251e29551271c633cad21c87dbfea666295ca /src-z80/core/sfx.z80 | |
| parent | 49bde702d51519e676389e9445b2acdde42c3841 (diff) | |
FM loader code optimized (Oerg's work), also some FM-related bugfixes around
Diffstat (limited to 'src-z80/core/sfx.z80')
| -rw-r--r-- | src-z80/core/sfx.z80 | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/src-z80/core/sfx.z80 b/src-z80/core/sfx.z80 index 6eb844d..0e140e8 100644 --- a/src-z80/core/sfx.z80 +++ b/src-z80/core/sfx.z80 @@ -262,21 +262,9 @@ ClearSFX: xor a ld (de), a - dec b ; Mute FM channel - ld (ix+0), $28 - ld (ix+1), b - PollPCM - ld a, b - and $04 ; Determine which port to write - rrca - ld iyl, a - - ld a, b ; Kill ADSR - call KillFM - - PollPCM + dec b ld a, b ; Restore BGM FM instrument ld h, RAM_BGMFMInstr>>8 @@ -292,31 +280,23 @@ ClearSFX: PollPCM push bc - ld a, b ; Restore BGM FM volume - add RAM_BGMFMVol&$FF + ld a, l ; Restore BGM FM volume + add 8 ld l, a ld a, b ld b, (hl) call SetFMVolLoad pop bc - ld a, b - and $04 - rrca - ld iyl, a - - push bc ; Restore BGM FM panning - ld a, b - ld h, RAM_BGMFMPan>>8 - add RAM_BGMFMPan&$FF + ld a, l ; Restore BGM FM panning + add 8 ld l, a ld a, b - ld b, (hl) and $03 add $B4 - ld (iy+0), b + ld (iy+0), a + ld a, (hl) ld (iy+1), a - pop bc PollPCM inc b |
