changeset 228:4d979914e837

Use jvmReset appropriately, fixes(?) taotao.xm vs. boost.xm vs. vital.xm issues.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 08 Oct 2012 01:45:26 +0300
parents b7e23d91a8c2
children 301de8c0cd01
files jssplr.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/jssplr.c	Mon Oct 08 01:44:34 2012 +0300
+++ b/jssplr.c	Mon Oct 08 01:45:26 2012 +0300
@@ -876,9 +876,11 @@
         {
             if (chn->ninstrument != tmp)
                 JMPSETNDFLAGS(cdfNewInstr);
+            else
+                JMPSETNDFLAGS(cdfPlay);
 
             chn->ninstrument = tmp;
-            chn->instrument  = mp->module->instruments[chn->ninstrument];
+            chn->instrument  = mp->module->instruments[tmp];
 
             if (newExtInstrument)
             {
@@ -1552,7 +1554,10 @@
             }
 
             if (flags & cdfPlay)
+            {
+                jvmReset(mp->device, channel);
                 jvmPlay(mp->device, channel);
+            }
 
             if (flags & cdfNewPitch)
                 jmpCSetPitch(mp, chn, chn->pitch);
@@ -1564,7 +1569,7 @@
                 jvmSetPos(mp->device, channel, chn->position);
 
             if (flags & cdfNewVolume)
-                jmpCSetVolume(mp, chn, channel, chn->volume, flags & (cdfNewInstr | cdfPlay));
+                jmpCSetVolume(mp, chn, channel, chn->volume, flags & cdfNewInstr);
 
             if (flags & cdfNewPanPos)
                 jmpCSetPanning(mp, chn, channel, chn->panning);