diff options
Diffstat (limited to 'src-z80/player')
| -rw-r--r-- | src-z80/player/fm.z80 | 40 | ||||
| -rw-r--r-- | src-z80/player/pcm.z80 | 5 |
2 files changed, 43 insertions, 2 deletions
diff --git a/src-z80/player/fm.z80 b/src-z80/player/fm.z80 index 8afd0e7..130948f 100644 --- a/src-z80/player/fm.z80 +++ b/src-z80/player/fm.z80 @@ -798,6 +798,9 @@ SetFMReg: PollPCM ; Get parameters call GetParam + ld a, b + cp $27 + jr z, .setch3 push bc PollPCM call GetParam @@ -810,6 +813,43 @@ SetFMReg: ret ; End of subroutine +;---------------------------------------------------------------------------- + +.setch3: + ; Register $27 is the timer triggers, but also holds ch3 mode + ; It's handled separately in order to only modify the ch3 mode bits + ; and modify the register writes to keep them + + PollPCM ; Get new ch3 mode + call GetParam + PollPCM + + ld a, b ; Set ch3 mode now, without touching + and $C0 ; either timer + or $0F + ld b, a + ld a, $27 + ld (iy+0), a + ld (iy+0), b + + PollPCM + + ld a, b ; Update timer writes (so they don't undo + and $C0 ; the ch3 mode change) + + ld a, (UpdatePCM_Tick-1) ; (timer A) + and $3F + or a, b + ld (UpdatePCM_Tick-1), a + + ld a, (DoTick_Tick-1) ; (timer B) + and $3F + or a, b + ld (DoTick_Tick-1), a + + PollPCM + ret ; End of subroutine + ;**************************************************************************** ; LockChannelFM [events $E0-$E7] ; Locks a FM channel diff --git a/src-z80/player/pcm.z80 b/src-z80/player/pcm.z80 index 2b7bcc4..688683a 100644 --- a/src-z80/player/pcm.z80 +++ b/src-z80/player/pcm.z80 @@ -9,9 +9,10 @@ UpdatePCM: exx ; Switch to PCM registers -.doagain: +UpdatePCM_Again: ld (ix+0), $27 ; Acknowledge timer ld (ix+1), $1F +UpdatePCM_Tick: ;push hl ;ld hl, $1F27 ;ld ($4000), hl @@ -129,7 +130,7 @@ UpdatePCM: .nobankchg: ld l, RAM_PCMBuffer&$FF ; Go back to the beginning of the buffer - jp .doagain ; We took so long we should play the next + jp UpdatePCM_Again ; We took so long we should play the next ; sample already ._.' ;**************************************************************************** |
