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); } }
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); } }
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); } }
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); } }
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); }
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); }
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); }
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); }