# HG changeset patch # User Matti Hamalainen # Date 1425567094 -7200 # Node ID 83693e2797dd0659b62a710f451dcaa808c69437 # Parent 1587a2f0a2bcfbebf974e21877b091daed7d1829 Comments. diff -r 1587a2f0a2bc -r 83693e2797dd tools/xm2jss.c --- a/tools/xm2jss.c Thu Mar 05 16:51:08 2015 +0200 +++ b/tools/xm2jss.c Thu Mar 05 16:51:34 2015 +0200 @@ -223,7 +223,9 @@ { Uint8 qflags = 0; int qcomp = 0; - + + // Determine what would get stored, + // aka actually how much space we use JSCOMP(note->note, COMP_NOTE); JSCOMP(note->instrument, COMP_INSTRUMENT); JSCOMP(note->volume, COMP_VOLUME); @@ -236,6 +238,7 @@ if (qcomp < 4) { + // Okay, it's less than 4 bytes, so use compressed JSPUTBYTE(qflags | 0x80); if (note->note != jsetNotSet) @@ -250,9 +253,13 @@ JSCOMPPUT(COMP_VOLUME, note->volume, "Volume"); JSCOMPPUT(COMP_EFFECT, note->effect, "Effect"); JSCOMPPUT(COMP_PARAM, note->param, "Param"); - } else + } + else + { + // Was 4 bytes or more, just dump it all in .. return jssConvertNote(patBuf, patBufSize, patSize, note); - + } + return DMERR_OK; }