diff options
Diffstat (limited to 'src-z80/player/pcm.z80')
| -rw-r--r-- | src-z80/player/pcm.z80 | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src-z80/player/pcm.z80 b/src-z80/player/pcm.z80 index 18527d9..b5a4434 100644 --- a/src-z80/player/pcm.z80 +++ b/src-z80/player/pcm.z80 @@ -239,3 +239,30 @@ LockChannelPCM: call StopPCM ; Stop PCM playback jp ProcessSFXRun ; End of subroutine + +;**************************************************************************** +; SetPCMRate [command $07] +; Changes the sample rate of PCM +;**************************************************************************** + +SetPCMRate: + ld a, (RAM_ComBank) ; Get new rate + cpl + ld b, a + + xor a ; Parsed command already + ld (RAM_Command), a + + ld a, b ; Set high bits of timer + ld (ix+0), $24 + rrca + rrca + or $C0 + ld (ix+1), a + + ld a, b ; Set low bits of timer + ld (ix+0), $25 + and $03 + ld (ix+1), a + + jp IdleLoop ; End of subroutine |
