changeset 1177:dc26df8b642c

Some support for 0x0102 version of the XM format. Does not work fully yet, probably due to different pattern data storing method or something.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 05 Mar 2015 09:58:07 +0200
parents afdbf62ce8ad
children f1bbac567942
files minijss/jloadxm.c
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/minijss/jloadxm.c	Thu Mar 05 09:57:02 2015 +0200
+++ b/minijss/jloadxm.c	Thu Mar 05 09:58:07 2015 +0200
@@ -645,8 +645,13 @@
         }
     }
 
+    // Read sample data if needed
+    if (module->intVersion == 0x0104)
+    {
         if ((ret = jssXMLoadInstrumentSamples(inFile, module, einst, ninst)) != DMERR_OK)
             return ret;
+    }
+
     return DMERR_OK;
 }
 
@@ -834,6 +839,7 @@
     switch (xmH.version)
     {
         case 0x0104:
+        case 0x0102:
             break;
 
         default:
@@ -902,6 +908,21 @@
                 goto out;
             break;
 
+        case 0x0102:
+            if ((ret = jssXMLoadInstruments(inFile, module)) != DMERR_OK)
+                goto out;
+
+            if ((ret = jssXMLoadPatterns(inFile, module, &xmH)) != DMERR_OK)
+                goto out;
+
+            // Read sample data if needed
+            for (index = 0; index < module->nextInstruments; index++)
+            {
+                JSSExtInstrument *einst = module->extInstruments[index];
+                if ((ret = jssXMLoadInstrumentSamples(inFile, module, einst, index)) != DMERR_OK)
+                    goto out;
+            }
+            break;
     }
 
 out: