From e5ee253099df1e5f750c40ce48b84be60bde9593 Mon Sep 17 00:00:00 2001 From: "K.Ohta" Date: Tue, 7 Mar 2017 02:42:53 +0900 Subject: [PATCH] [VM] Commit lacked files to commit. --- source/src/vm/event.cpp | 21 +++++++++++---------- source/src/vm/pcm1bit.cpp | 1 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/source/src/vm/event.cpp b/source/src/vm/event.cpp index a185f3894..80ecf991b 100644 --- a/source/src/vm/event.cpp +++ b/source/src/vm/event.cpp @@ -411,7 +411,7 @@ double EVENT::get_event_remaining_usec(int register_id) void EVENT::touch_sound(void) { if(!config.sound_strict_rendering) { - if((need_mix <= 0) && !sound_touched) { + if((need_mix <= 0) /* && !sound_touched */) { int samples = mix_counter; if(samples >= (sound_tmp_samples - buffer_ptr)) { samples = sound_tmp_samples - buffer_ptr - 1; @@ -420,9 +420,9 @@ void EVENT::touch_sound(void) mix_sound(samples); mix_counter -= samples; } - if(mix_counter < 1) { - mix_counter = 1; - } + //if(mix_counter < 1) { + // mix_counter = 1; + //} sound_touched = true; } } @@ -464,18 +464,19 @@ void EVENT::event_callback(int event_id, int err) mix_counter = 1; sound_touched = false; } else { - if(/*(need_mix > 0) || */(mix_counter >= mix_limit) || sound_touched) { + if((need_mix > 0) || (mix_counter >= mix_limit) /* || sound_touched */) { if(samples > 0) { mix_sound(samples); mix_counter -= samples; } - if(mix_counter < 1) { - mix_counter = 1; - } + // if(mix_counter < 1) { + // mix_counter = 1; + //} sound_touched = false; - } else { - mix_counter++; + //} else { + // mix_counter++; } + mix_counter++; } } } diff --git a/source/src/vm/pcm1bit.cpp b/source/src/vm/pcm1bit.cpp index 084dccc10..f7efd7f6d 100644 --- a/source/src/vm/pcm1bit.cpp +++ b/source/src/vm/pcm1bit.cpp @@ -32,6 +32,7 @@ void PCM1BIT::write_signal(int id, uint32_t data, uint32_t mask) if(id == SIG_PCM1BIT_SIGNAL) { bool next = ((data & mask) != 0); if(signal != next) { + touch_sound(); if(signal) { positive_clocks += get_passed_clock(prev_clock); } else { -- 2.11.0