diff options
| author | Javier Degirolmo | 2012-07-15 21:02:54 -0300 |
|---|---|---|
| committer | Javier Degirolmo | 2012-07-15 21:02:54 -0300 |
| commit | c7cf8a2eb4178f59a5dfe2c3ad6bf1a39eeca523 (patch) | |
| tree | ddaf8602e1d089644753d6e0a52421f35b730b10 /src-z80/player | |
| parent | 84ce0220dd5449587467c37d7afbd99fb1fbe69e (diff) | |
Added BGM pausing support (stop BGM to pause, resume BGM to unpause)
Diffstat (limited to 'src-z80/player')
| -rw-r--r-- | src-z80/player/fm.z80 | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src-z80/player/fm.z80 b/src-z80/player/fm.z80 index ddfef66..65a6c55 100644 --- a/src-z80/player/fm.z80 +++ b/src-z80/player/fm.z80 @@ -755,3 +755,48 @@ KillFM: PollPCM ret ; End of subroutine + +;**************************************************************************** +; RestoreFM +; Restores a FM channel (from BGM information) +;---------------------------------------------------------------------------- +; input b ... FM channel (0..7) +;---------------------------------------------------------------------------- +; breaks: af, hl +;**************************************************************************** + +RestoreFM: + ld a, b ; Restore BGM FM instrument + ld h, RAM_BGMFMInstr>>8 + add RAM_BGMFMInstr&$FF + ld l, a + + push bc + ld a, b + ld b, (hl) + call LoadFMDirect + pop bc + + PollPCM + + push bc + ld a, l ; Restore BGM FM volume + add 8 + ld l, a + ld a, b + ld b, (hl) + call SetFMVolLoad + pop bc + + ld a, l ; Restore BGM FM panning + add 8 + ld l, a + ld a, b + and $03 + add $B4 + ld (iy+0), a + ld a, (hl) + ld (iy+1), a + + PollPCM + ret ; End of subroutine |
