Mercurial > hg > dmlib
diff tools/xm2jss.c @ 1334:ea9ab5b84985
Comments.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 22 Aug 2017 14:28:40 +0300 |
parents | 17c23f0494f5 |
children | caf414847662 |
line wrap: on
line diff
--- a/tools/xm2jss.c Tue Aug 22 14:04:32 2017 +0300 +++ b/tools/xm2jss.c Tue Aug 22 14:28:40 2017 +0300 @@ -620,6 +620,7 @@ { JSSExtInstrument *einst = module->extInstruments[index]; + // Misc data BOOL ok = dm_fwrite_byte(outFile, einst->nsamples) && dm_fwrite_byte(outFile, einst->vibratoType) && @@ -628,6 +629,7 @@ dm_fwrite_le16(outFile, einst->vibratoRate) && dm_fwrite_le16(outFile, einst->fadeOut); + // Sample number for note(s) for (int i = 0; ok && i < jsetNNotes; i++) { int snum = einst->sNumForNotes[i]; @@ -635,6 +637,7 @@ ok = dm_fwrite_le32(outFile, tmp); } + // Envelopes if (!ok || !jssMODWriteEnvelope(outFile, &einst->volumeEnv, "volume", index) || !jssMODWriteEnvelope(outFile, &einst->panningEnv, "panning", index)) @@ -661,11 +664,13 @@ if (module->instruments[index] != NULL) { JSSInstrument *inst = module->instruments[index]; + + // Determine conversion flags to use inst->convFlags = (inst->flags & jsf16bit) ? flags16 : flags8; if (inst->data != NULL) inst->convFlags |= jsampHasData; - // Write instrument header to file + // Write instrument header if (!dm_fwrite_le32(outFile, inst->size) || !dm_fwrite_le32(outFile, inst->loopS) || !dm_fwrite_le32(outFile, inst->loopE) || @@ -687,7 +692,8 @@ else { JSSWARNING(DMERR_NULLPTR, DMERR_NULLPTR, - "Instrument #%d NULL!\n", index); + "Instrument #%d NULL!\n", + index); } dmMsg(1," * %d Instrument headers, %d bytes.\n",