static void _stream_update(void *param/*, int interval*/) { ym3526_state *info = (ym3526_state *)param; //stream_update(info->stream); ym3526_update_one(info->chip, DUMMYBUF, 0); }
static int sfx_soundexpander_sound_machine_calculate_samples(sound_t *psid, SWORD *pbuf, int nr, int interleave, int *delta_t) { int i; int j; SWORD *buffer; buffer = lib_malloc(nr * 2); if (sfx_soundexpander_chip == 3812) { ym3812_update_one(YM3812_chip, buffer, nr); } else { ym3526_update_one(YM3526_chip, buffer, nr); } for (i = 0; i < nr; i++) { for (j = 0; j < interleave; j++) { pbuf[(i * interleave) + j] = sound_audio_mix(pbuf[(i * interleave) + j], buffer[i]); } } lib_free(buffer); return nr; }
static int sfx_soundexpander_sound_machine_calculate_samples(sound_t **psid, SWORD *pbuf, int nr, int soc, int scc, int *delta_t) { int i; SWORD *buffer; buffer = lib_malloc(nr * 2); if (sfx_soundexpander_chip == 3812 && YM3812_chip) { ym3812_update_one(YM3812_chip, buffer, nr); } else if (sfx_soundexpander_chip == 3526 && YM3526_chip) { ym3526_update_one(YM3526_chip, buffer, nr); } for (i = 0; i < nr; i++) { pbuf[i * soc] = sound_audio_mix(pbuf[i * soc], buffer[i]); if (soc > 1) { pbuf[(i * soc) + 1] = sound_audio_mix(pbuf[(i * soc) + 1], buffer[i]); } } lib_free(buffer); return nr; }
void ym3526_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { ym3526_update_one(m_chip, outputs[0], samples); }
//static STREAM_UPDATE( ym3526_stream_update ) void ym3526_stream_update(void *param, stream_sample_t **outputs, int samples) { ym3526_state *info = (ym3526_state *)param; ym3526_update_one(info->chip, outputs, samples); }
void Opl_Apu::run_until( blip_time_t end_time ) { if ( end_time > next_time ) { blip_time_t time_delta = end_time - next_time; blip_time_t time = next_time; unsigned count = time_delta / period_ + 1; switch (type_) { case type_opll: case type_msxmusic: case type_smsfmunit: case type_vrc7: { SAMP bufMO[ 1024 ]; SAMP bufRO[ 1024 ]; SAMP * buffers[2] = { bufMO, bufRO }; while ( count > 0 ) { unsigned todo = count; if ( todo > 1024 ) todo = 1024; ym2413_update_one( opl, buffers, todo ); if ( output_ ) { int last_amp = this->last_amp; for ( unsigned i = 0; i < todo; i++ ) { int amp = bufMO [i] + bufRO [i]; int delta = amp - last_amp; if ( delta ) { last_amp = amp; synth.offset_inline( time, delta, output_ ); } time += period_; } this->last_amp = last_amp; } else time += period_ * todo; count -= todo; } } break; case type_opl: case type_msxaudio: case type_opl2: { OPLSAMPLE buffer[ 1024 ]; while ( count > 0 ) { unsigned todo = count; if ( todo > 1024 ) todo = 1024; switch (type_) { case type_opl: ym3526_update_one( opl, buffer, todo ); break; case type_msxaudio: y8950_update_one( opl, buffer, todo ); break; case type_opl2: ym3812_update_one( opl, buffer, todo ); break; default: break; } if ( output_ ) { int last_amp = this->last_amp; for ( unsigned i = 0; i < todo; i++ ) { int amp = buffer [i]; int delta = amp - last_amp; if ( delta ) { last_amp = amp; synth.offset_inline( time, delta, output_ ); } time += period_; } this->last_amp = last_amp; } else time += period_ * todo; count -= todo; } } break; } next_time = time; } }
static STREAM_UPDATE( ym3526_stream_update ) { ym3526_state *info = (ym3526_state *)param; ym3526_update_one(info->chip, outputs[0], samples); }