printk("gf1_volume = 0x%x\n", voice->gf1_volume); 
/* printk("gf1_volume = 0x%x\n", voice->gf1_volume); */ 
static void do_volume_envelope(snd_gus_card_t *gus, snd_gus_voice_t *voice){	unsigned short next, rate, old_volume;	int program_next_ramp;	unsigned long flags;  	if (!gus->gf1.volume_ramp) {		spin_lock_irqsave(&gus->reg_lock, flags);		snd_gf1_select_voice(gus, voice->number);		snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL);		snd_gf1_write16(gus, SNDRV_GF1_VW_VOLUME, voice->gf1_volume);		printk("gf1_volume = 0x%x\n", voice->gf1_volume);		spin_unlock_irqrestore(&gus->reg_lock, flags);		return;	}	program_next_ramp = 0;	rate = next = 0;	while (1) {		program_next_ramp = 0;		rate = next = 0;		switch (voice->venv_state) {		case VENV_BEFORE:			voice->venv_state = VENV_ATTACK;			voice->venv_value_next = 0;			spin_lock_irqsave(&gus->reg_lock, flags);			snd_gf1_select_voice(gus, voice->number);			snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL);			snd_gf1_write16(gus, SNDRV_GF1_VW_VOLUME, SNDRV_GF1_MIN_VOLUME);			spin_unlock_irqrestore(&gus->reg_lock, flags);			break;		case VENV_ATTACK:			voice->venv_state = VENV_SUSTAIN;			program_next_ramp++;			next = 255;			rate = gus->gf1.volume_ramp;			break;		case VENV_SUSTAIN:			voice->venv_state = VENV_RELEASE;			spin_lock_irqsave(&gus->reg_lock, flags);			snd_gf1_select_voice(gus, voice->number);			snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL); 			snd_gf1_write16(gus, SNDRV_GF1_VW_VOLUME, ((int)voice->gf1_volume * (int)voice->venv_value_next) / 255);			spin_unlock_irqrestore(&gus->reg_lock, flags);			return;		case VENV_RELEASE:			voice->venv_state = VENV_DONE;			program_next_ramp++;			next = 0;			rate = gus->gf1.volume_ramp;			break;		case VENV_DONE:			snd_gf1_stop_voice(gus, voice->number);			voice->flags &= ~SNDRV_GF1_VFLG_RUNNING;			return;		case VENV_VOLUME:			program_next_ramp++;			next = voice->venv_value_next;			rate = gus->gf1.volume_ramp;			voice->venv_state = voice->venv_state_prev;			break;		}		voice->venv_value_next = next;		if (!program_next_ramp)			continue;		spin_lock_irqsave(&gus->reg_lock, flags);		snd_gf1_select_voice(gus, voice->number);		snd_gf1_ctrl_stop(gus, SNDRV_GF1_VB_VOLUME_CONTROL);		old_volume = snd_gf1_read16(gus, SNDRV_GF1_VW_VOLUME) >> 8;		if (!rate) {			spin_unlock_irqrestore(&gus->reg_lock, flags);						continue;		}		next = (((int)voice->gf1_volume * (int)next) / 255) >> 8;		if (old_volume < SNDRV_GF1_MIN_OFFSET)			old_volume = SNDRV_GF1_MIN_OFFSET;		if (next < SNDRV_GF1_MIN_OFFSET)			next = SNDRV_GF1_MIN_OFFSET;		if (next > SNDRV_GF1_MAX_OFFSET)			next = SNDRV_GF1_MAX_OFFSET;		if (old_volume == next) {			spin_unlock_irqrestore(&gus->reg_lock, flags);			continue;		}		voice->volume_control &= ~0xc3;		voice->volume_control |= 0x20;		if (old_volume > next) {			snd_gf1_write8(gus, SNDRV_GF1_VB_VOLUME_START, next);			snd_gf1_write8(gus, SNDRV_GF1_VB_VOLUME_END, old_volume);			voice->volume_control |= 0x40;		} else {			snd_gf1_write8(gus, SNDRV_GF1_VB_VOLUME_START, old_volume);			snd_gf1_write8(gus, SNDRV_GF1_VB_VOLUME_END, next);		}		snd_gf1_write8(gus, SNDRV_GF1_VB_VOLUME_RATE, rate);		snd_gf1_write8(gus, SNDRV_GF1_VB_VOLUME_CONTROL, voice->volume_control);		if (!gus->gf1.enh_mode) {			snd_gf1_delay(gus);			snd_gf1_write8(gus, SNDRV_GF1_VB_VOLUME_CONTROL, voice->volume_control);		}		spin_unlock_irqrestore(&gus->reg_lock, flags);					return;	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/99b359ba10a582148c6725f428a33ba5356dd993/gus_simple.c/buggy/sound/isa/gus/gus_simple.c