Previous 15994 Revisions Next

r2959 Thursday 17th July, 2008 at 14:47:48 UTC by Miodrag Milanović
[SPECIAL][B2M] Fixed broken drivers
[src/mess/audio]special.c
[src/mess/machine]b2m.c

src/mess/audio/special.c
r2958r2959
3131static void *specimx_sh_start(int clock, const struct CustomSound_interface *config)
3232{
3333   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);
3535   return (void *) ~0;
3636}
3737
r2958r2959
4242   INT16 channel_2_signal;
4343
4444   stream_sample_t *sample_left = buffer[0];
45   stream_sample_t *sample_right = buffer[1];
4645
4746   channel_0_signal = specimx_input[0] ? 3000 : -3000;
4847   channel_1_signal = specimx_input[1] ? 3000 : -3000;
r2958r2959
5150   while (length--)
5251   {
5352      *sample_left = 0;
54      *sample_right = 0;
5553
5654      /* music channel 0 */
5755      *sample_left += channel_0_signal;
r2958r2959
6361      *sample_left += channel_2_signal;
6462
6563      sample_left++;
66      sample_right++;
6764   }
6865}
6966
7067void specimx_set_input(int index, int state)
7168{
72   stream_update( mixer_channel );
69   if (mixer_channel!=NULL) {
70      stream_update( mixer_channel );
71   }
7372   specimx_input[index] = state;
7473}
7574
src/mess/machine/b2m.c
r2958r2959
167167
168168static PIT8253_OUTPUT_CHANGED(bm2_pit_out1)
169169{
170   stream_update( mixer_channel );
170   if (mixer_channel!=NULL) {
171      stream_update( mixer_channel );
172   }
171173   b2m_sound_input = state;
172174}
173175
r2958r2959
472474static void *b2m_sh_start(int clock, const struct CustomSound_interface *config)
473475{
474476   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);
476478   return (void *) ~0;
477479}
478480
r2958r2959
481483   INT16 channel_1_signal;
482484
483485   stream_sample_t *sample_left = buffer[0];
484   stream_sample_t *sample_right = buffer[1];
485486
486487   channel_1_signal = b2m_sound_input ? 3000 : -3000;
487488
488489   while (length--)
489490   {
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;     
497492      sample_left++;
498      sample_right++;
499493   }
500494}
501495
502496void b2m_sh_change_clock(double clock)
503497{
504   stream_update(mixer_channel);
498   if (mixer_channel!=NULL) {
499      stream_update(mixer_channel);
500   }
505501}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team