diff options
| author | Sik | 2019-03-31 19:27:51 -0300 |
|---|---|---|
| committer | Sik | 2019-03-31 19:27:51 -0300 |
| commit | e4da3571aa25e5798e1d96fe3df600bcd806403d (patch) | |
| tree | e93b021ded2635ede409a7b0b86aed604f1e2e1f /src-z80/player/fm.z80 | |
| parent | 46ce4f706ea47d16db70018baedd5eb6c691ef95 (diff) | |
Echo 1.64, random bugfixes
Diffstat (limited to 'src-z80/player/fm.z80')
| -rw-r--r-- | src-z80/player/fm.z80 | 40 |
1 files changed, 40 insertions, 0 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 |
