OSDN Git Service

[VM][EVENT][SOUND] Fix problems voice with PCM (at least MSX and FM-7(Reviver)).
authorK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 25 Jan 2017 08:44:21 +0000 (17:44 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 25 Jan 2017 08:44:21 +0000 (17:44 +0900)
See http://hanabi.2ch.net/test/read.cgi/i4004/1483504365/37 .

source/src/vm/event.cpp
source/src/vm/event.h

index 503d6ef..5b7df9c 100644 (file)
@@ -425,12 +425,11 @@ void EVENT::event_callback(int event_id, int err)
                        int t_s = mix_counter;
                        if(t_s >= (sound_tmp_samples - buffer_ptr)) t_s = sound_tmp_samples - buffer_ptr - 1; 
                        if(config.sound_strict_rendering) {
-                               if(t_s <= 1) {
-                                       mix_sound(1);
-                                       mix_counter = 1;
-                                       sound_touched = false;
-                                       return;
-                               }
+                               if(t_s < 1) t_s = 1;
+                               mix_sound(t_s);
+                               mix_counter = 1;
+                               sound_touched = false;
+                               return;
                        }
                        if((need_mix > 0) || (mix_counter >= mix_limit) || sound_touched) {
                                if(t_s > 0) {
index 8c06452..167b882 100644 (file)
@@ -198,6 +198,7 @@ public:
        }
        void touch_sound(void)
        {
+               if(config.sound_strict_rendering) return;
                if((need_mix <= 0) && !sound_touched) {
                        int t_s = mix_counter;
                        // Do need mix_sound(remain_samples) before?