Exemple #1
0
void sound_timer(fixed16_16 frequency_step, int channel) {
	direct_sound_struct *ds = direct_sound_channel + channel;

	fixed16_16 fifo_fractional = ds->fifo_fractional;
	u32 buffer_index = ds->buffer_index;
	s16 current_sample, next_sample, dest_sample;

	current_sample = ds->fifo[ds->fifo_base] << 4;
	ds->fifo_base = (ds->fifo_base + 1) % 32;
	next_sample = ds->fifo[ds->fifo_base] << 4;

	if (sound_on) {
		if (ds->volume == DIRECT_SOUND_VOLUME_50) {
			current_sample >>= 1;
			next_sample >>= 1;
		}
		switch (ds->status) {
			case DIRECT_SOUND_INACTIVE:
				render_samples(null);
				break;
			case DIRECT_SOUND_RIGHT:
				render_samples(right);
				break;
			case DIRECT_SOUND_LEFT:
				render_samples(left);
				break;
			case DIRECT_SOUND_LEFTRIGHT:
				render_samples(both);
				break;
		}
	} else {
Exemple #2
0
static COMMAND_FUNC( do_render )
{
	Data_Obj *intens_dp, *image_dp, *coord_dp;

	image_dp=pick_obj( "target image" );
	intens_dp=pick_obj( "source list of sampled intensities" );
	coord_dp=pick_obj( "coordinate list" );
	if( intens_dp==NULL || image_dp==NULL || coord_dp==NULL )
		return;

	render_samples(QSP_ARG  image_dp,coord_dp,intens_dp);
}