changeset 1337:04b1bf207636

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 22 Aug 2017 14:50:38 +0300
parents 1f097180bed3
children 2603f6ca632e
files tools/xm2jss.c
diffstat 1 files changed, 19 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/tools/xm2jss.c	Tue Aug 22 14:46:45 2017 +0300
+++ b/tools/xm2jss.c	Tue Aug 22 14:50:38 2017 +0300
@@ -739,12 +739,16 @@
     JSSNote *n = pattern->data;
     *empty = FALSE;
 
-    // Check all notes in this pattern to see what instruments are used
+    // Check all notes in this pattern
     for (int row = 0; row < pattern->nrows; row++)
     for (int channel = 0; channel < pattern->nchannels; channel++, n++)
     {
+        char effect;
+
+        // Is the instrument set?
         if (n->instrument != jsetNotSet)
         {
+            // Is it valid?
             if (n->instrument >= 0 && n->instrument < module->nextInstruments)
                 usedExtInstruments[n->instrument] = TRUE;
             else
@@ -754,30 +758,29 @@
             }
         }
 
+        // Check if this channel is used
         if (n->note != jsetNotSet ||
             n->instrument != jsetNotSet ||
             n->volume != jsetNotSet ||
             n->effect != jsetNotSet ||
             n->param != jsetNotSet)
         {
-            char effect;
-
             usedChannels[channel] = TRUE;
             *empty = FALSE;
+        }
 
-            // Convert certain effects
-            JMPGETEFFECT(effect, n->effect);
-            switch (effect)
-            {
-                case 'C': // Cxx = Set volume
-                    if (n->volume == jsetNotSet)
-                    {
-                        n->volume = n->param;
-                        n->effect = jsetNotSet;
-                        n->param = jsetNotSet;
-                    }
-                    break;
-            }
+        // Convert certain effects
+        JMPGETEFFECT(effect, n->effect);
+        switch (effect)
+        {
+            case 'C': // Cxx = Set volume
+                if (n->volume == jsetNotSet)
+                {
+                    n->volume = n->param;
+                    n->effect = jsetNotSet;
+                    n->param = jsetNotSet;
+                }
+                break;
         }
     }
 }