changeset 1111:f9a96fc2a932

Adjust messages to show user-visible (1 based) instrument numbers.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 04 Mar 2015 01:15:17 +0200
parents ea2cc4932714
children 14bd24790929
files tools/xm2jss.c
diffstat 1 files changed, 18 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/tools/xm2jss.c	Wed Mar 04 01:10:35 2015 +0200
+++ b/tools/xm2jss.c	Wed Mar 04 01:15:17 2015 +0200
@@ -710,7 +710,7 @@
                     else
                     {
                         dmMsg(2, "Pattern 0x%x, row=0x%x, chn=%d has invalid instrument 0x%x\n",
-                        pattern, row, channel, n->instrument);
+                        pattern, row, channel, n->instrument + 1);
                     }
                 }
             }
@@ -755,7 +755,7 @@
             else
             {
                 dmErrorMsg("Ext.instrument #%d sNumForNotes[%d] value out range (%d < %d).\n",
-                    i, m->ninstruments, q);
+                    i + 1, m->ninstruments, q + 1);
             }
         }
     }
@@ -807,17 +807,18 @@
         if (i >= m->ninstruments)
         {
             dmErrorMsg("Instrument 0x%x >= 0x%x, but used!\n",
-                i, m->ninstruments);
+                i + 1, m->ninstruments);
             continue;
         }
 
         if ((ip = m->instruments[i]) == NULL)
         {
-            dmErrorMsg("Instrument 0x%x used but is NULL.\n", i);
+            dmErrorMsg("Instrument 0x%x used but is NULL.\n", i + 1);
             continue;
         }
 
-        dmPrint(2, "%02x -> %02x : ", i, r->ninstruments);
+        dmPrint(2, "%02x -> %02x : ", i + 1, r->ninstruments + 1);
+
         mapInstruments[i] = r->ninstruments;
         r->instruments[r->ninstruments] = ip;
         (r->ninstruments)++;
@@ -850,17 +851,18 @@
         if (i >= m->nextInstruments)
         {
             dmErrorMsg("Ext.instrument 0x%x >= 0x%x, but used!\n",
-                i, m->nextInstruments);
+                i + 1, m->nextInstruments);
             continue;
         }
 
         if ((eip = m->extInstruments[i]) == NULL)
         {
-            dmErrorMsg("Extended instrument 0x%x used but is NULL.\n", i);
+            dmErrorMsg("Extended instrument 0x%x used but is NULL.\n", i + 1);
             continue;
         }
 
-        dmPrint(2, "%02x -> %02x : ", i, r->nextInstruments);
+        dmPrint(2, "%02x -> %02x : ", i + 1, r->nextInstruments + 1);
+
         mapExtInstruments[i] = r->nextInstruments;
         r->extInstruments[r->nextInstruments] = eip;
         (r->nextInstruments)++;
@@ -879,9 +881,11 @@
                 else
                 {
                     map = jsetNotSet;
-                    dmErrorMsg("e=%d, note=%d, q=%d/%d\n", i, note, q, r->ninstruments);
+                    dmErrorMsg("Einst=%d, note=%d, sNumForNote=%d (%d max)\n",
+                        i + 1, note, q + 1, r->ninstruments);
                 }
-                dmPrint(3, "%02x.%02x ", q, map);
+
+                dmPrint(3, "%02x.%02x ", q + 1, map + 1);
                 eip->sNumForNotes[note] = map;
             }
         }
@@ -916,7 +920,10 @@
                     n->instrument = mapExtInstruments[n->instrument];
 
                 if (n->instrument != jsetNotSet && r->extInstruments[n->instrument] == NULL)
-                    dmErrorMsg("Non-existing instrument used #%d.\n", n->instrument);
+                {
+                    dmErrorMsg("Non-existing instrument used #%d.\n",
+                        n->instrument + 1);
+                }
             }
 
             JMPGETEFFECT(effect, n->effect);