diff options
| author | sik | 2018-01-22 19:19:19 -0300 |
|---|---|---|
| committer | sik | 2018-01-22 19:19:19 -0300 |
| commit | 8fdf49b8e53fd3063ccc2eb51c49c3b6e4d073bb (patch) | |
| tree | addb91518f99d4df76986d3e282e41cd6baf077e /src-z80/player/fm.z80 | |
| parent | a2f67fbe8fe6b27f661e70ce2b6b75c17cd1fe54 (diff) | |
Echo 1.6 release... kind of a mess, will clean up in further commits I guess
Diffstat (limited to 'src-z80/player/fm.z80')
| -rw-r--r-- | src-z80/player/fm.z80 | 60 |
1 files changed, 57 insertions, 3 deletions
diff --git a/src-z80/player/fm.z80 b/src-z80/player/fm.z80 index d5d49ba..8afd0e7 100644 --- a/src-z80/player/fm.z80 +++ b/src-z80/player/fm.z80 @@ -49,8 +49,9 @@ NoteOnFM: PollPCM call GetParam ; Get note PollPCM - ex af, af' + +SetFMSemitone: push de push hl @@ -175,8 +176,8 @@ SetNoteFMBGM: jp ProcessBGMRun ; End of subroutine SetNoteFM: - push af ld b, a + ex af, af' PollPCM ld a, b ; Determine which port to write @@ -188,7 +189,11 @@ SetNoteFM: call GetParam ; Get high byte PollPCM - pop af + ld a, b ; Is it a semitone? + add a, a + jp c, .freqtone + + ex af, af' push de and $07 @@ -217,6 +222,14 @@ SetNoteFM: pop de ret ; End of subroutine +;---------------------------------------------------------------------------- + +.freqtone: + inc a + ld b, a + ex af, af' + jp SetFMSemitone + ;**************************************************************************** ; LoadFM* [events $40~$47] ; Loads a FM instrument @@ -678,6 +691,16 @@ SetFMParamSFX: PollPCM call GetParam ; Get parameters PollPCM + + ld a, (RAM_Mono) ; Is stereo disabled? (always turn on both + or a ; speakers in that case) + jr z, .sfxpanok + ld a, b + or $C0 + ld b, a + PollPCM +.sfxpanok: + ex af, af' and $03 ; Get channel ID @@ -701,6 +724,16 @@ SetFMParamBGM: PollPCM call GetParam ; Get parameters PollPCM + + ld a, (RAM_Mono) ; Is stereo disabled? (always turn on both + or a ; speakers in that case) + jr z, .bgmpanok + ld a, b + or $C0 + ld b, a + PollPCM +.bgmpanok: + ex af, af' push hl @@ -880,6 +913,14 @@ KillFM: dec c jp nz, .loaddummy + ld e, 0 ; Make the pitch so low it's unherable + add 4 ; because the above is STILL not enough + ld (iy+0), a ; sometimes. If you ever notice a very low + ld (iy+1), e ; pitch waveform... this is why + sub 4 + ld (iy+0), a + ld (iy+1), e + pop hl pop de PollPCM @@ -941,3 +982,16 @@ RestoreFM: PollPCM ret ; End of subroutine + +;**************************************************************************** +; SetStereo [command $09] +; Toggles whether stereo is enabled or not. +;---------------------------------------------------------------------------- +; notes: doesn't return +;**************************************************************************** + +SetStereo: + ld a, (RAM_ComBank) ; Just copy the argument as-is + ld (RAM_Mono), a + + jp EndOfCommand ; End of subroutine |
