Lines Matching +full:8 +full:- +full:ch

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Copyright (C) 1999-2000 Takashi Iwai <tiwai@suse.de>
22 static void reset_voice(struct snd_emux *emu, int ch);
39 static void snd_emu8000_tweak_voice(struct snd_emu8000 *emu, int ch);
43 * macro evaluates its args more than once, so changed to upper-case.
74 hw->emu->ops = emu8000_ops; in snd_emu8000_ops_setup()
88 hw = vp->hw; in release_voice()
89 dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease; in release_voice()
90 EMU8000_DCYSUS_WRITE(hw, vp->ch, dcysusv); in release_voice()
91 dcysusv = 0x8000 | (unsigned char)vp->reg.parm.volrelease; in release_voice()
92 EMU8000_DCYSUSV_WRITE(hw, vp->ch, dcysusv); in release_voice()
103 hw = vp->hw; in terminate_voice()
104 EMU8000_DCYSUSV_WRITE(hw, vp->ch, 0x807F); in terminate_voice()
115 hw = vp->hw; in update_voice()
121 vp->port->ctrls[EMUX_MD_REALTIME_PAN]) in update_voice()
140 * The channel index (vp->ch) must be initialized in this routine.
162 hw = emu->hw; in get_voice()
165 best[i].time = (unsigned int)(-1); /* XXX MAX_?INT really */ in get_voice()
166 best[i].voice = -1; in get_voice()
172 for (i = 0; i < emu->max_voices; i++) { in get_voice()
175 vp = &emu->voices[i]; in get_voice()
176 state = vp->state; in get_voice()
183 val = (EMU8000_CVCF_READ(hw, vp->ch) >> 16) & 0xffff; in get_voice()
192 /* check if sample is finished playing (non-looping only) */ in get_voice()
194 (vp->reg.sample_mode & SNDRV_SFNT_SAMPLE_SINGLESHOT)) { in get_voice()
195 val = EMU8000_CCCA_READ(hw, vp->ch) & 0xffffff; in get_voice()
196 if (val >= vp->reg.loopstart) in get_voice()
200 if (vp->time < bp->time) { in get_voice()
201 bp->time = vp->time; in get_voice()
202 bp->voice = i; in get_voice()
208 vp = &emu->voices[best[i].voice]; in get_voice()
209 vp->ch = best[i].voice; in get_voice()
224 int ch; in start_voice() local
229 hw = vp->hw; in start_voice()
230 ch = vp->ch; in start_voice()
231 chan = vp->chan; in start_voice()
234 EMU8000_DCYSUSV_WRITE(hw, ch, 0x0080); in start_voice()
235 EMU8000_VTFT_WRITE(hw, ch, 0x0000FFFF); in start_voice()
236 EMU8000_CVCF_WRITE(hw, ch, 0x0000FFFF); in start_voice()
237 EMU8000_PTRX_WRITE(hw, ch, 0); in start_voice()
238 EMU8000_CPF_WRITE(hw, ch, 0); in start_voice()
244 EMU8000_ENVVAL_WRITE(hw, ch, vp->reg.parm.moddelay); in start_voice()
245 EMU8000_ATKHLD_WRITE(hw, ch, vp->reg.parm.modatkhld); in start_voice()
246 EMU8000_DCYSUS_WRITE(hw, ch, vp->reg.parm.moddcysus); in start_voice()
247 EMU8000_ENVVOL_WRITE(hw, ch, vp->reg.parm.voldelay); in start_voice()
248 EMU8000_ATKHLDV_WRITE(hw, ch, vp->reg.parm.volatkhld); in start_voice()
256 EMU8000_PEFE_WRITE(hw, ch, vp->reg.parm.pefe); in start_voice()
259 EMU8000_LFO1VAL_WRITE(hw, ch, vp->reg.parm.lfo1delay); in start_voice()
260 EMU8000_LFO2VAL_WRITE(hw, ch, vp->reg.parm.lfo2delay); in start_voice()
271 /* chorus & loop end (chorus 8bit, MSB) */ in start_voice()
272 addr = vp->reg.loopend - 1; in start_voice()
273 temp = vp->reg.parm.chorus; in start_voice()
274 temp += (int)chan->control[MIDI_CTL_E3_CHORUS_DEPTH] * 9 / 10; in start_voice()
277 EMU8000_CSL_WRITE(hw, ch, temp); in start_voice()
280 addr = vp->reg.start - 1; in start_voice()
281 temp = vp->reg.parm.filterQ; in start_voice()
283 EMU8000_CCCA_WRITE(hw, ch, temp); in start_voice()
286 EMU8000_00A0_WRITE(hw, ch, 0); in start_voice()
287 EMU8000_0080_WRITE(hw, ch, 0); in start_voice()
290 temp = vp->vtarget << 16; in start_voice()
291 EMU8000_VTFT_WRITE(hw, ch, temp | vp->ftarget); in start_voice()
292 EMU8000_CVCF_WRITE(hw, ch, temp | 0xff00); in start_voice()
303 int ch = vp->ch; in trigger_voice() local
307 hw = vp->hw; in trigger_voice()
310 temp = vp->reg.parm.reverb; in trigger_voice()
311 temp += (int)vp->chan->control[MIDI_CTL_E1_REVERB_DEPTH] * 9 / 10; in trigger_voice()
313 temp = (temp << 8) | (vp->ptarget << 16) | vp->aaux; in trigger_voice()
314 EMU8000_PTRX_WRITE(hw, ch, temp); in trigger_voice()
315 EMU8000_CPF_WRITE(hw, ch, vp->ptarget << 16); in trigger_voice()
316 EMU8000_DCYSUSV_WRITE(hw, ch, vp->reg.parm.voldcysus); in trigger_voice()
323 reset_voice(struct snd_emux *emu, int ch) in reset_voice() argument
327 hw = emu->hw; in reset_voice()
328 EMU8000_DCYSUSV_WRITE(hw, ch, 0x807F); in reset_voice()
329 snd_emu8000_tweak_voice(hw, ch); in reset_voice()
338 EMU8000_IP_WRITE(hw, vp->ch, vp->apitch); in set_pitch()
349 ifatn = (unsigned char)vp->acutoff; in set_volume()
350 ifatn = (ifatn << 8); in set_volume()
351 ifatn |= (unsigned char)vp->avol; in set_volume()
352 EMU8000_IFATN_WRITE(hw, vp->ch, ifatn); in set_volume()
363 temp = ((unsigned int)vp->apan<<24) | ((unsigned int)vp->reg.loopstart - 1); in set_pan()
364 EMU8000_PSST_WRITE(hw, vp->ch, temp); in set_pan()
377 pitch = (char)(vp->reg.parm.fmmod>>8); in set_fmmod()
378 cutoff = (vp->reg.parm.fmmod & 0xff); in set_fmmod()
379 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in set_fmmod()
381 LIMITVALUE(pitch, -128, 127); in set_fmmod()
382 fmmod = ((unsigned char)pitch<<8) | cutoff; in set_fmmod()
383 EMU8000_FMMOD_WRITE(hw, vp->ch, fmmod); in set_fmmod()
390 EMU8000_TREMFRQ_WRITE(hw, vp->ch, vp->reg.parm.tremfrq); in set_tremfreq()
402 pitch = (char)(vp->reg.parm.fm2frq2>>8); in set_fm2frq2()
403 freq = vp->reg.parm.fm2frq2 & 0xff; in set_fm2frq2()
404 modulation = vp->chan->gm_modulation + vp->chan->midi_pressure; in set_fm2frq2()
406 LIMITVALUE(pitch, -128, 127); in set_fm2frq2()
407 fm2frq2 = ((unsigned char)pitch<<8) | freq; in set_fm2frq2()
408 EMU8000_FM2FRQ2_WRITE(hw, vp->ch, fm2frq2); in set_fm2frq2()
416 addr = EMU8000_CCCA_READ(hw, vp->ch) & 0xffffff; in set_filterQ()
417 addr |= (vp->reg.parm.filterQ << 28); in set_filterQ()
418 EMU8000_CCCA_WRITE(hw, vp->ch, addr); in set_filterQ()
451 hw = emu->hw; in sysex()
455 hw->chorus_mode = chset->gs_chorus_mode; in sysex()
460 hw->reverb_mode = chset->gs_reverb_mode; in sysex()
476 hw = emu->hw; in oss_ioctl()
480 hw->reverb_mode = p1; in oss_ioctl()
485 hw->chorus_mode = p1; in oss_ioctl()
494 hw->bass_level = p1; in oss_ioctl()
495 hw->treble_level = p2; in oss_ioctl()
520 hw = emu->hw; in load_fx()
524 len -= 16; in load_fx()
532 return -EINVAL; in load_fx()