//static STREAM_UPDATE( ym2413_stream_update ) void ym2413_stream_update(void *_info, stream_sample_t **outputs, int samples) { ym2413_state *info = (ym2413_state*)_info; switch(info->EMU_CORE) { #ifdef ENABLE_ALL_CORES case EC_MAME: ym2413_update_one(info->chip, outputs, samples); break; #endif case EC_EMU2413: OPLL_calc_stereo(info->chip, outputs, samples, -1); break; } }
static void _stream_update(void *param, int interval) { ym2413_state *info = (ym2413_state *)param; /*stream_update(info->stream);*/ switch(info->EMU_CORE) { #ifdef ENABLE_ALL_CORES case EC_MAME: ym2413_update_one(info->chip, DUMMYBUF, 0); break; #endif case EC_EMU2413: OPLL_calc_stereo(info->chip, DUMMYBUF, 0, -1); break; } }
static STREAM_UPDATE( ym2413_stream_update ) { ym2413_state *info = (ym2413_state *)param; ym2413_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; } }