void end_frame() { #if !defined(PSP) && !defined(EMSCRIPTEN) apu.end_frame(MAX_CYCLES); stereo_buf.end_frame(MAX_CYCLES); if (stereo_buf.samples_avail() >= BUF_SIZE) { size_t count = stereo_buf.read_samples(sample_buffer, BUF_SIZE ); sound.write(sample_buffer, count ); } #endif }
int32 MDSound_Flush(int16 *SoundBuf, const int32 MaxSoundFrames) { int32 FrameCount = 0; UpdateFM(); apu.end_frame(md_timestamp / 15); zebuf.end_frame(md_timestamp / 15); if(SoundBuf) FrameCount = zebuf.read_samples(SoundBuf, MaxSoundFrames * 2) / 2; else zebuf.clear(); fm_last_timestamp = 0; return(FrameCount); }
int32 SMS_SoundFlush(int16 *SoundBuf, int32 MaxSoundFrames) { int32 FrameCount = 0; if(FMThing) UpdateFM(); apu.end_frame(sms.timestamp); zebuf.end_frame(sms.timestamp); if(SoundBuf) FrameCount = zebuf.read_samples(SoundBuf, MaxSoundFrames * 2) / 2; else zebuf.clear(); fm_last_timestamp = 0; return(FrameCount); }