示例#1
0
文件: cinemat.cpp 项目: ursine/mame
void cinemat_state::barrier_sound_w(UINT8 sound_val, UINT8 bits_changed)
{
	/* Player die - rising edge */
	if (SOUNDVAL_RISING_EDGE(0x01))
		m_samples->start(0, 0);

	/* Player move - falling edge */
	if (SOUNDVAL_FALLING_EDGE(0x02))
		m_samples->start(1, 1);

	/* Enemy move - falling edge */
	if (SOUNDVAL_FALLING_EDGE(0x04))
		m_samples->start(2, 2);
}
示例#2
0
static void barrier_sound_w(UINT8 sound_val, UINT8 bits_changed)
{
	/* Player die - rising edge */
	if (SOUNDVAL_RISING_EDGE(0x01))
		sample_start(0, 0, 0);

	/* Player move - falling edge */
	if (SOUNDVAL_FALLING_EDGE(0x02))
		sample_start(1, 1, 0);

	/* Enemy move - falling edge */
	if (SOUNDVAL_FALLING_EDGE(0x04))
		sample_start(2, 2, 0);
}
示例#3
0
static void barrier_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
    samples_device *samples = machine.device<samples_device>("samples");

    /* Player die - rising edge */
    if (SOUNDVAL_RISING_EDGE(0x01))
        samples->start(0, 0);

    /* Player move - falling edge */
    if (SOUNDVAL_FALLING_EDGE(0x02))
        samples->start(1, 1);

    /* Enemy move - falling edge */
    if (SOUNDVAL_FALLING_EDGE(0x04))
        samples->start(2, 2);
}
示例#4
0
static void barrier_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
	running_device *samples = machine->device("samples");

	/* Player die - rising edge */
	if (SOUNDVAL_RISING_EDGE(0x01))
		sample_start(samples, 0, 0, 0);

	/* Player move - falling edge */
	if (SOUNDVAL_FALLING_EDGE(0x02))
		sample_start(samples, 1, 1, 0);

	/* Enemy move - falling edge */
	if (SOUNDVAL_FALLING_EDGE(0x04))
		sample_start(samples, 2, 2, 0);
}
示例#5
0
文件: cinemat.cpp 项目: ursine/mame
void cinemat_state::speedfrk_sound_w(UINT8 sound_val, UINT8 bits_changed)
{
	/* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */
	if (SOUNDVAL_FALLING_EDGE(0x08))
	{
		m_current_shift = ((m_current_shift >> 1) & 0x7fff) | ((~sound_val << 13) & 1);
		/* high 12 bits control the frequency - counts from value to $FFF, carry triggers */
		/* another counter */

		/* low 4 bits control the volume of the noise output (explosion?) */
	}
示例#6
0
static void spacewar_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
    samples_device *samples = machine.device<samples_device>("samples");

    /* Explosion - rising edge */
    if (SOUNDVAL_RISING_EDGE(0x01))
        samples->start(0, (machine.rand() & 1) ? 0 : 6);

    /* Fire sound - rising edge */
    if (SOUNDVAL_RISING_EDGE(0x02))
        samples->start(1, (machine.rand() & 1) ? 1 : 7);

    /* Player 1 thrust - 0=on, 1=off */
    if (SOUNDVAL_FALLING_EDGE(0x04))
        samples->start(3, 3, true);
    if (SOUNDVAL_RISING_EDGE(0x04))
        samples->stop(3);

    /* Player 2 thrust - 0=on, 1-off */
    if (SOUNDVAL_FALLING_EDGE(0x08))
        samples->start(4, 4, true);
    if (SOUNDVAL_RISING_EDGE(0x08))
        samples->stop(4);

    /* Mute - 0=off, 1=on */
    if (SOUNDVAL_FALLING_EDGE(0x10))
        samples->start(2, 2, true);	/* play idle sound */
    if (SOUNDVAL_RISING_EDGE(0x10))
    {
        int i;

        /* turn off all but the idle sound */
        for (i = 0; i < 5; i++)
            if (i != 2)
                samples->stop(i);

        /* Pop when board is shut off */
        samples->start(2, 5);
    }
}
示例#7
0
static void spacewar_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
	running_device *samples = machine->device("samples");

	/* Explosion - rising edge */
	if (SOUNDVAL_RISING_EDGE(0x01))
		sample_start(samples, 0, (mame_rand(machine) & 1) ? 0 : 6, 0);

	/* Fire sound - rising edge */
	if (SOUNDVAL_RISING_EDGE(0x02))
		sample_start(samples, 1, (mame_rand(machine) & 1) ? 1 : 7, 0);

	/* Player 1 thrust - 0=on, 1=off */
	if (SOUNDVAL_FALLING_EDGE(0x04))
		sample_start(samples, 3, 3, 1);
	if (SOUNDVAL_RISING_EDGE(0x04))
		sample_stop(samples, 3);

	/* Player 2 thrust - 0=on, 1-off */
	if (SOUNDVAL_FALLING_EDGE(0x08))
		sample_start(samples, 4, 4, 1);
	if (SOUNDVAL_RISING_EDGE(0x08))
		sample_stop(samples, 4);

	/* Mute - 0=off, 1=on */
	if (SOUNDVAL_FALLING_EDGE(0x10))
		sample_start(samples, 2, 2, 1);	/* play idle sound */
	if (SOUNDVAL_RISING_EDGE(0x10))
	{
        int i;

		/* turn off all but the idle sound */
		for (i = 0; i < 5; i++)
			if (i != 2)
				sample_stop(samples, i);

		/* Pop when board is shut off */
		sample_start(samples, 2, 5, 0);
	}
}
示例#8
0
static void speedfrk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
	running_device *samples = machine->device("samples");

	/* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */
	if (SOUNDVAL_FALLING_EDGE(0x08))
	{
		current_shift = ((current_shift >> 1) & 0x7fff) | ((~sound_val << 13) & 1);
		/* high 12 bits control the frequency - counts from value to $FFF, carry triggers */
		/* another counter */

		/* low 4 bits control the volume of the noise output (explosion?) */
	}
示例#9
0
文件: cinemat.cpp 项目: ursine/mame
void cinemat_state::spacewar_sound_w(UINT8 sound_val, UINT8 bits_changed)
{
	/* Explosion - rising edge */
	if (SOUNDVAL_RISING_EDGE(0x01))
		m_samples->start(0, (machine().rand() & 1) ? 0 : 6);

	/* Fire sound - rising edge */
	if (SOUNDVAL_RISING_EDGE(0x02))
		m_samples->start(1, (machine().rand() & 1) ? 1 : 7);

	/* Player 1 thrust - 0=on, 1=off */
	if (SOUNDVAL_FALLING_EDGE(0x04))
		m_samples->start(3, 3, true);
	if (SOUNDVAL_RISING_EDGE(0x04))
		m_samples->stop(3);

	/* Player 2 thrust - 0=on, 1-off */
	if (SOUNDVAL_FALLING_EDGE(0x08))
		m_samples->start(4, 4, true);
	if (SOUNDVAL_RISING_EDGE(0x08))
		m_samples->stop(4);

	/* Mute - 0=off, 1=on */
	if (SOUNDVAL_FALLING_EDGE(0x10))
		m_samples->start(2, 2, true); /* play idle sound */
	if (SOUNDVAL_RISING_EDGE(0x10))
	{
		int i;

		/* turn off all but the idle sound */
		for (i = 0; i < 5; i++)
			if (i != 2)
				m_samples->stop(i);

		/* Pop when board is shut off */
		m_samples->start(2, 5);
	}
}
示例#10
0
static void spacewar_sound_w(UINT8 sound_val, UINT8 bits_changed)
{
	/* Explosion - rising edge */
	if (SOUNDVAL_RISING_EDGE(0x01))
		sample_start(0, (rand() & 1) ? 0 : 6, 0);

	/* Fire sound - rising edge */
	if (SOUNDVAL_RISING_EDGE(0x02))
		sample_start(1, (rand() & 1) ? 1 : 7, 0);

	/* Player 1 thrust - 0=on, 1=off */
	if (SOUNDVAL_FALLING_EDGE(0x04))
		sample_start(3, 3, 1);
	if (SOUNDVAL_RISING_EDGE(0x04))
		sample_stop(3);

	/* Player 2 thrust - 0=on, 1-off */
	if (SOUNDVAL_FALLING_EDGE(0x08))
		sample_start(4, 4, 1);
	if (SOUNDVAL_RISING_EDGE(0x08))
		sample_stop(4);

	/* Mute - 0=off, 1=on */
	if (SOUNDVAL_FALLING_EDGE(0x10))
		sample_start(2, 2, 1);	/* play idle sound */
	if (SOUNDVAL_RISING_EDGE(0x10))
	{
        int i;

		/* turn off all but the idle sound */
		for (i = 0; i < 5; i++)
			if (i != 2)
				sample_stop(i);

		/* Pop when board is shut off */
		sample_start(2, 5, 0);
	}
}