src/mess/audio/special.c
| r2958 | r2959 | |
| 31 | 31 | static void *specimx_sh_start(int clock, const struct CustomSound_interface *config) |
| 32 | 32 | { |
| 33 | 33 | specimx_input[0] = specimx_input[1] = specimx_input[2] = 0; |
| 34 | | mixer_channel = stream_create(0, 2, Machine->sample_rate, 0, specimx_sh_update); |
| 34 | mixer_channel = stream_create(0, 1, Machine->sample_rate, 0, specimx_sh_update); |
| 35 | 35 | return (void *) ~0; |
| 36 | 36 | } |
| 37 | 37 | |
| r2958 | r2959 | |
| 42 | 42 | INT16 channel_2_signal; |
| 43 | 43 | |
| 44 | 44 | stream_sample_t *sample_left = buffer[0]; |
| 45 | | stream_sample_t *sample_right = buffer[1]; |
| 46 | 45 | |
| 47 | 46 | channel_0_signal = specimx_input[0] ? 3000 : -3000; |
| 48 | 47 | channel_1_signal = specimx_input[1] ? 3000 : -3000; |
| r2958 | r2959 | |
| 51 | 50 | while (length--) |
| 52 | 51 | { |
| 53 | 52 | *sample_left = 0; |
| 54 | | *sample_right = 0; |
| 55 | 53 | |
| 56 | 54 | /* music channel 0 */ |
| 57 | 55 | *sample_left += channel_0_signal; |
| r2958 | r2959 | |
| 63 | 61 | *sample_left += channel_2_signal; |
| 64 | 62 | |
| 65 | 63 | sample_left++; |
| 66 | | sample_right++; |
| 67 | 64 | } |
| 68 | 65 | } |
| 69 | 66 | |
| 70 | 67 | void specimx_set_input(int index, int state) |
| 71 | 68 | { |
| 72 | | stream_update( mixer_channel ); |
| 69 | if (mixer_channel!=NULL) { |
| 70 | stream_update( mixer_channel ); |
| 71 | } |
| 73 | 72 | specimx_input[index] = state; |
| 74 | 73 | } |
| 75 | 74 | |
src/mess/machine/b2m.c
| r2958 | r2959 | |
| 167 | 167 | |
| 168 | 168 | static PIT8253_OUTPUT_CHANGED(bm2_pit_out1) |
| 169 | 169 | { |
| 170 | | stream_update( mixer_channel ); |
| 170 | if (mixer_channel!=NULL) { |
| 171 | stream_update( mixer_channel ); |
| 172 | } |
| 171 | 173 | b2m_sound_input = state; |
| 172 | 174 | } |
| 173 | 175 | |
| r2958 | r2959 | |
| 472 | 474 | static void *b2m_sh_start(int clock, const struct CustomSound_interface *config) |
| 473 | 475 | { |
| 474 | 476 | b2m_sound_input = 0; |
| 475 | | mixer_channel = stream_create(0, 2, Machine->sample_rate, 0, b2m_sh_update); |
| 477 | mixer_channel = stream_create(0, 1, Machine->sample_rate, 0, b2m_sh_update); |
| 476 | 478 | return (void *) ~0; |
| 477 | 479 | } |
| 478 | 480 | |
| r2958 | r2959 | |
| 481 | 483 | INT16 channel_1_signal; |
| 482 | 484 | |
| 483 | 485 | stream_sample_t *sample_left = buffer[0]; |
| 484 | | stream_sample_t *sample_right = buffer[1]; |
| 485 | 486 | |
| 486 | 487 | channel_1_signal = b2m_sound_input ? 3000 : -3000; |
| 487 | 488 | |
| 488 | 489 | while (length--) |
| 489 | 490 | { |
| 490 | | *sample_left = 0; |
| 491 | | *sample_right = 0; |
| 492 | | |
| 493 | | /* music channel 1 */ |
| 494 | | |
| 495 | | *sample_left = channel_1_signal; |
| 496 | | |
| 491 | *sample_left = channel_1_signal; |
| 497 | 492 | sample_left++; |
| 498 | | sample_right++; |
| 499 | 493 | } |
| 500 | 494 | } |
| 501 | 495 | |
| 502 | 496 | void b2m_sh_change_clock(double clock) |
| 503 | 497 | { |
| 504 | | stream_update(mixer_channel); |
| 498 | if (mixer_channel!=NULL) { |
| 499 | stream_update(mixer_channel); |
| 500 | } |
| 505 | 501 | } |