diff src/xs_sidplay.h @ 849:2663b1ac9ce6

Improve debugging.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 08 Nov 2012 23:02:05 +0200
parents ae1f6418d093
children
line wrap: on
line diff
--- a/src/xs_sidplay.h	Thu Nov 08 22:44:50 2012 +0200
+++ b/src/xs_sidplay.h	Thu Nov 08 23:02:05 2012 +0200
@@ -31,33 +31,27 @@
     XSTuneInfo *res;
     TTUNEINFO info;
     TTUNE *tune;
-    guint8 *buf = NULL;
-    size_t bufSize = 0;
 
-    /* Load file */
-    if (xs_fload_buffer(filename, &buf, &bufSize) != 0)
-        return NULL;
-    
     /* Check if the tune exists and is readable */
-    if ((tune = new TTUNE(buf, bufSize)) == NULL)
+    if ((tune = new TTUNE(filename)) == NULL)
     {
-        g_free(buf);
+        XSDEBUG("could not initialize tune from '%s'.\n", filename);
         return NULL;
     }
-    g_free(buf);
 
     if (!tune->getStatus())
     {
+        XSDEBUG("tune->getStatus() returned false for '%s'.\n", filename);
         delete tune;
         return NULL;
     }
 
     /* Get general tune information */
-#ifdef XS_SIDPLAY1_H
+#if defined(XS_SIDPLAY1_H)
     tune->getInfo(info);
-#endif
-
-#ifdef XS_SIDPLAY2_H
+#elif defined(XS_SIDPLAY2_H)
+    info = tune->getInfo();
+#elif defined(XS_SIDPLAYFP_H)
     info = tune->getInfo();
 #endif