Пример #1
0
static void cclimber_play_sample(running_machine &machine, int start,int freq,int volume)
{
	int len;
	int romlen = machine.region("samples")->bytes();
	const UINT8 *rom = machine.region("samples")->base();
	device_t *samples = machine.device("samples");


	if (!rom) return;

	/* decode the rom samples */
	len = 0;
	while (start + len < romlen && rom[start+len] != 0x70)
	{
		int sample;

		sample = (rom[start + len] & 0xf0) >> 4;
		samplebuf[2*len] = SAMPLE_CONV4(sample) * volume / 31;

		sample = rom[start + len] & 0x0f;
		samplebuf[2*len + 1] = SAMPLE_CONV4(sample) * volume / 31;

		len++;
	}

	sample_start_raw(samples,0,samplebuf,2 * len,freq,0);
}
Пример #2
0
static void cclimber_play_sample(int start,int freq,int volume)
{
	int len;
	const UINT8 *rom = memory_region(REGION_SOUND1);


	if (!rom) return;

	/* decode the rom samples */
	len = 0;
	while (start + len < memory_region_length(REGION_SOUND1) && rom[start+len] != 0x70)
	{
		int sample;

		sample = (rom[start + len] & 0xf0) >> 4;
		samplebuf[2*len] = SAMPLE_CONV4(sample) * volume / 31;

		sample = rom[start + len] & 0x0f;
		samplebuf[2*len + 1] = SAMPLE_CONV4(sample) * volume / 31;

		len++;
	}

	sample_start_raw(0,samplebuf,2 * len,freq,0);
}
Пример #3
0
void targ_sh_start(void)
{
	tone_pointer=0;
	tone_offset=0;
	tone_active=0;
	sound_a_freq = 0x00;
	sample_set_volume(3,0);
	sample_start_raw(3,waveform1,32,1000,1);
}
Пример #4
0
void polyplay_play_channel2(int data)
{
	if (data) {
		freq2 = 2457600 / 16 / data / 8;
		sample_set_volume(1, channel_playing2 * 1.0);
		sample_start_raw(1, backgroundwave, ARRAY_LENGTH(backgroundwave), sizeof(backgroundwave)*freq2,1);
	}
	else {
		sample_stop(0);
		sample_stop(1);
	}
}
Пример #5
0
void play_channel1(int data)
{
    if (data) {
        freq1 = 2457600 / 16 / data / 8;
        sample_set_volume(0, channel_playing1 * 1.0);
        sample_start_raw(0, backgroundwave, sizeof(backgroundwave)/2, sizeof(backgroundwave)*freq1,1);
    }
    else {
        sample_stop(0);
        sample_stop(1);
    }
}
Пример #6
0
static WRITE8_HANDLER( pbillian_sample_trigger_w )
{
	int start,end;

	start = data << 7;
	/* look for end of sample marker */
	end = start;
	while (end < 0x8000 && samplebuf[end] != (0xff^0x80))
		end++;

	sample_start_raw(0, samplebuf + start, end - start, 5000, 0); /* 5khz ? */
}
Пример #7
0
static WRITE8_HANDLER( pbillian_sample_trigger_w )
{
	running_device *samples = space->machine->device("samples");
	int start,end;

	start = data << 7;
	/* look for end of sample marker */
	end = start;
	while (end < 0x8000 && samplebuf[end] != (0xff^0x80))
		end++;

	sample_start_raw(samples, 0, samplebuf + start, end - start, 5000, 0); // 5khz ?
}
Пример #8
0
void polyplay_play_channel2(running_machine *machine, int data)
{
	running_device *samples = devtag_get_device(machine, "samples");
	if (data) {
		freq2 = 2457600 / 16 / data / 8;
		sample_set_volume(samples, 1, channel_playing2 * 1.0);
		sample_start_raw(samples, 1, backgroundwave, ARRAY_LENGTH(backgroundwave), sizeof(backgroundwave)*freq2,1);
	}
	else {
		sample_stop(samples, 0);
		sample_stop(samples, 1);
	}
}
Пример #9
0
void polyplay_play_channel1(running_machine *machine, int data)
{
	device_t *samples = machine->device("samples");
	if (data) {
		freq1 = 2457600 / 16 / data / 8;
		sample_set_volume(samples, 0, channel_playing1 * 1.0);
		sample_start_raw(samples, 0, backgroundwave, ARRAY_LENGTH(backgroundwave), sizeof(backgroundwave)*freq1,1);
	}
	else {
		sample_stop(samples, 0);
		sample_stop(samples, 1);
	}
}
Пример #10
0
static void common_audio_start(running_machine *machine, int freq)
{
	device_t *samples = machine->device("samples");
	max_freq = freq;

	tone_freq = 0;
	tone_active = 0;

	sample_set_volume(samples, 3, 0);
	sample_start_raw(samples, 3, sine_wave, 32, 1000, 1);

	state_save_register_global(machine, port_1_last);
	state_save_register_global(machine, port_2_last);
	state_save_register_global(machine, tone_freq);
	state_save_register_global(machine, tone_active);
}
Пример #11
0
void senjyo_sh_start(void)
{
    int i;

	/* z80 ctc init */
	ctc_intf.baseclock = Machine->drv->cpu[1].cpu_clock;
	z80ctc_init (0, &ctc_intf);

	/* z80 pio init */
	z80pio_init (0, &pio_intf);

	_single = (INT16 *)auto_malloc(SINGLE_LENGTH*2);

	for (i = 0;i < SINGLE_LENGTH;i++)		/* freq = ctc2 zco / 8 */
		_single[i] = ((i/SINGLE_DIVIDER)&0x01)*127*256;

	/* CTC2 single tone generator */
	sample_set_volume(0,0);
	sample_start_raw(0,_single,SINGLE_LENGTH,single_rate,1);

	timer_pulse(TIME_IN_HZ(Machine->refresh_rate), 0, senjyo_sh_update);
}
Пример #12
0
void senjyo_sh_start(void)
{
    int i;

	/* z80 ctc init */
	ctc_intf.baseclock = cpunum_get_clock(1);
	z80ctc_init (0, &ctc_intf);

	/* z80 pio init */
	z80pio_init (0, &pio_intf);

	_single = (INT16 *)auto_malloc(SINGLE_LENGTH*2);

	for (i = 0;i < SINGLE_LENGTH;i++)		/* freq = ctc2 zco / 8 */
		_single[i] = ((i/SINGLE_DIVIDER)&0x01)*127*256;

	/* CTC2 single tone generator */
	sample_set_volume(0,0);
	sample_start_raw(0,_single,SINGLE_LENGTH,single_rate,1);

	timer_pulse(video_screen_get_frame_period(Machine->primary_screen), NULL, 0, senjyo_sh_update);
}