UIQ3 update, some makefile unification, rm old configs, stuff
[picodrive.git] / Pico / cd / cue.c
index 39c635a..d02062c 100644 (file)
@@ -6,6 +6,13 @@
 #include "../PicoInt.h"
 // #define elprintf(w,f,...) printf(f "\n",##__VA_ARGS__);
 
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+#ifdef UIQ3
+#define snprintf(b,s,...) sprintf(b,##__VA_ARGS__)
+#endif
+
 static char *mystrip(char *str)
 {
        int i, len;
@@ -86,9 +93,7 @@ cue_data_t *cue_parse(const char *fname)
 
                mystrip(buff);
                if (buff[0] == 0) continue;
-               if      (BEGINS(buff, "REM"))
-                       continue;
-               else if (BEGINS(buff, "TITLE ") || BEGINS(buff, "PERFORMER ") || BEGINS(buff, "SONGWRITER "))
+               if      (BEGINS(buff, "TITLE ") || BEGINS(buff, "PERFORMER ") || BEGINS(buff, "SONGWRITER "))
                        continue;       /* who would put those here? Ignore! */
                else if (BEGINS(buff, "FILE "))
                {
@@ -199,6 +204,16 @@ cue_data_t *cue_parse(const char *fname)
                        else
                                pending_pregap = m*60*75 + s*75 + f;
                }
+               else if (BEGINS(buff, "REM LENGTH ")) // custom "extension"
+               {
+                       int m, s, f;
+                       get_token(buff+11, buff2, sizeof(buff2));
+                       ret = sscanf(buff2, "%d:%d:%d", &m, &s, &f);
+                       if (ret != 3) continue;
+                       data->tracks[count].sector_xlength = m*60*75 + s*75 + f;
+               }
+               else if (BEGINS(buff, "REM"))
+                       continue;
                else
                {
                        elprintf(EL_STATUS, "cue: unhandled line: \"%s\"", buff);