Mercurial > hg > dmlib
changeset 1201:83693e2797dd
Comments.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 05 Mar 2015 16:51:34 +0200 |
parents | 1587a2f0a2bc |
children | 9c1cde761c51 |
files | tools/xm2jss.c |
diffstat | 1 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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; }