Ejemplo n.º 1
0
void MSM5205_playmode_w(int num,int select)
{
	struct MSM5205Voice *voice = sndti_token(SOUND_MSM5205, num);
	static const int prescaler_table[4] = {96,48,64,0};
	int prescaler = prescaler_table[select & 3];
	int bitwidth = (select & 4) ? 4 : 3;


	if( voice->prescaler != prescaler )
	{
		stream_update(voice->stream,0);

		voice->prescaler = prescaler;
		/* timer set */
		if( prescaler )
		{
			double period = TIME_IN_HZ(voice->clock / prescaler);
			timer_adjust_ptr(voice->timer, period, period);
		}
		else
			timer_adjust_ptr(voice->timer, TIME_NEVER, 0);
	}

	if( voice->bitwidth != bitwidth )
	{
		stream_update(voice->stream,0);

		voice->bitwidth = bitwidth;
	}
}
Ejemplo n.º 2
0
static void TimerHandler_3812(void *param,int c,double period)
{
	struct ym3812_info *info = param;
	if( period == 0 )
	{	/* Reset FM Timer */
		timer_enable(info->timer[c], 0);
	}
	else
	{	/* Start FM Timer */
		timer_adjust_ptr(info->timer[c], period, 0);
	}
}
Ejemplo n.º 3
0
/* TimerHandler from fm.c */
static void TimerHandler(void *param,int c,int count,double stepTime)
{
	struct ym2610_info *info = param;
	if( count == 0 )
	{	/* Reset FM Timer */
		timer_enable(info->timer[c], 0);
	}
	else
	{	/* Start FM Timer */
		double timeSec = (double)count * stepTime;
		if (!timer_enable(info->timer[c], 1))
			timer_adjust_ptr(info->timer[c], timeSec, 0);
	}
}
Ejemplo n.º 4
0
/* TimerHandler from fm.c */
static void TimerHandler(void *param,int c,int count,double stepTime)
{
	struct ym2612_info *info = param;
	if( count == 0 )
	{	/* Reset FM Timer */
		timer_enable(info->timer[c], 0);
	}
	else
	{	/* Start FM Timer */
		double timeSec = (double)count * stepTime;
		double slack;

		slack = timer_get_time() - info->lastfired[c];
		/* hackish way to make bstars intro sync without */
		/* breaking sonicwi2 command 0x35 */
		if (slack < 0.000050) slack = 0;

		if (!timer_enable(info->timer[c], 1))
			timer_adjust_ptr(info->timer[c], timeSec - slack, 0);
	}
}