Core/burn/snd/es5506.cpp
/**********************************************************************************************

     generate_samples -- tell each voice to generate samples

***********************************************************************************************/
- tell each voice to generate samples
- tell each voice to generate samples
static void generate_samples(INT32 *left, INT32 *right, INT32 samples)
{
	INT32 v;
	if (!samples)
		return;
	memset(left, 0, samples * sizeof(left[0]));
	memset(right, 0, samples * sizeof(right[0]));
	for (v = 0; v <= chip->active_voices; v++)
	{
		es5506_voice *voice = &chip->voice[v];
		UINT16 *base = chip->region_base[voice->control >> 14];
		if (voice->start == voice->end)
			voice->control |= CONTROL_STOP0;
		if (!base)
		{
			generate_dummy(voice, base, left, right, samples);
		}
		else if (voice->control & 0x2000)
			generate_ulaw(voice, base, left, right, samples);
		else
			generate_pcm(voice, base, left, right, samples);
		if (voice->control&CONTROL_IRQ)
		{
			if (chip->irqv&0x80)
			{
				chip->irqv=v&0x7f;
				voice->control&=~CONTROL_IRQ;
				update_irq_state();
			}
		}
	}
}
static void generate_samples ( INT32 * left , INT32 * right , INT32 samples ) { INT32 v ; if ( ! samples ) return ; memset ( left , 0 , samples * sizeof ( left [ 0 ] ) ) ; memset ( right , 0 , samples * sizeof ( right [ 0 ] ) ) ; for ( v = 0 ; v <= chip -> active_voices ; v ++ ) { es5506_voice * voice = & chip -> voice [ v ] ; UINT16 * base = chip -> region_base [ voice -> control >> 14 ] ; if ( voice -> start == voice -> end ) voice -> control |= CONTROL_STOP0 ; if ( ! base ) { generate_dummy ( voice , base , left , right , samples ) ; } else if ( voice -> control & 0x2000 ) generate_ulaw ( voice , base , left , right , samples ) ; else generate_pcm ( voice , base , left , right , samples ) ; if ( voice -> control & CONTROL_IRQ ) { if ( chip -> irqv & 0x80 ) { chip -> irqv = v & 0x7f ; voice -> control &= ~ CONTROL_IRQ ; update_irq_state ( ) ; } } } }
generate_samples -- tell each voice to generate samples
generate_samples -- tell each voice to generate samples
/* skip if nothing to do */ /* clear out the accumulator */ /* loop over voices */ /* special case: if end == start, stop the voice */ /* generate from the appropriate source */ //			logerror("NULL region base %d\n",voice->control >> 14); /* does this voice have it's IRQ bit raised? */ //logerror("IRQ raised on voice %d!!\n",v); /* only update voice vector if existing IRQ is acked by host */ /* latch voice number into vector, and set high bit low */ /* take down IRQ bit on voice */ /* inform host of irq */