Mercurial > hg > dmlib
annotate tools/dumpmod.c @ 1315:7687412f9aef
Fix jssmod sample conversion flags storing .. urgh.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 20 Aug 2017 01:54:54 +0300 |
parents | 5b8245e5f785 |
children | 172a42eb290b |
rev | line source |
---|---|
0 | 1 /* |
942
38cad00b41dd
Rename viewmod utility to dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
860
diff
changeset
|
2 * dumpmod - View information about given module file |
0 | 3 * Programmed and designed by Matti 'ccr' Hamalainen |
942
38cad00b41dd
Rename viewmod utility to dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
860
diff
changeset
|
4 * (C) Copyright 2006-2015 Tecnic Software productions (TNSP) |
0 | 5 * |
6 * Please read file 'COPYING' for information on license and distribution. | |
7 */ | |
8 #include "jss.h" | |
9 #include "jssmod.h" | |
10 #include <errno.h> | |
11 #include "dmargs.h" | |
285
245b15cd1919
Don't link libSDL uselessly to utilities that do not actually use it.
Matti Hamalainen <ccr@tnsp.org>
parents:
152
diff
changeset
|
12 #include "dmmutex.h" |
0 | 13 |
14 | |
15 char *optFilename = NULL; | |
16 BOOL optViewPatterns = FALSE, | |
17 optViewInstruments = FALSE, | |
18 optViewExtInstruments = FALSE, | |
795 | 19 optViewGeneralInfo = FALSE, |
20 optDump = FALSE; | |
0 | 21 |
22 | |
860
daebbf28953d
The argument handling API in dmargs* was synced with th-libs.
Matti Hamalainen <ccr@tnsp.org>
parents:
797
diff
changeset
|
23 static const DMOptArg optList[] = |
0 | 24 { |
25 { 0, '?', "help", "Show this help and exit", OPT_NONE }, | |
26 { 1, 'p', "patterns", "View patterns", OPT_NONE }, | |
27 { 2, 'i', "instruments", "View instruments", OPT_NONE }, | |
28 { 5, 'e', "extinstruments", "View extended instruments", OPT_NONE }, | |
29 { 3, 'g', "general", "General information", OPT_NONE }, | |
30 { 4, 'v', "verbose", "Be more verbose", OPT_NONE }, | |
795 | 31 { 6, 'd', "dump", "Dump mode", OPT_NONE }, |
0 | 32 }; |
33 | |
34 const int optListN = sizeof(optList) / sizeof(optList[0]); | |
35 | |
36 | |
37 void argShowHelp() | |
38 { | |
39 dmPrintBanner(stdout, dmProgName, "[options] [modfile]"); | |
860
daebbf28953d
The argument handling API in dmargs* was synced with th-libs.
Matti Hamalainen <ccr@tnsp.org>
parents:
797
diff
changeset
|
40 dmArgsPrintHelp(stdout, optList, optListN, 0); |
0 | 41 } |
42 | |
43 | |
44 BOOL argHandleOpt(const int optN, char *optArg, char *currArg) | |
45 { | |
46 (void) optArg; | |
1235
5b8245e5f785
Remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1200
diff
changeset
|
47 |
0 | 48 switch (optN) |
49 { | |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
50 case 0: |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
51 argShowHelp(); |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
52 exit(0); |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
53 break; |
0 | 54 |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
55 case 1: |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
56 optViewPatterns = TRUE; |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
57 break; |
0 | 58 |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
59 case 2: |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
60 optViewInstruments = TRUE; |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
61 break; |
0 | 62 |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
63 case 3: |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
64 optViewGeneralInfo = TRUE; |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
65 break; |
0 | 66 |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
67 case 4: |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
68 dmVerbosity++; |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
69 break; |
0 | 70 |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
71 case 5: |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
72 optViewExtInstruments = TRUE; |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
73 break; |
0 | 74 |
795 | 75 case 6: |
76 optDump = TRUE; | |
77 break; | |
78 | |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
79 default: |
958
985225a93aeb
Add error code parameter to dmError() and dmErrorVA().
Matti Hamalainen <ccr@tnsp.org>
parents:
942
diff
changeset
|
80 dmErrorMsg("Unknown argument '%s'.\n", currArg); |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
81 return FALSE; |
0 | 82 } |
1235
5b8245e5f785
Remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1200
diff
changeset
|
83 |
0 | 84 return TRUE; |
85 } | |
86 | |
87 | |
88 BOOL argHandleFile(char *currArg) | |
89 { | |
90 // Was not option argument | |
91 if (!optFilename) | |
92 optFilename = currArg; | |
93 else { | |
958
985225a93aeb
Add error code parameter to dmError() and dmErrorVA().
Matti Hamalainen <ccr@tnsp.org>
parents:
942
diff
changeset
|
94 dmErrorMsg("Gay error '%s'!\n", currArg); |
0 | 95 return FALSE; |
96 } | |
1235
5b8245e5f785
Remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1200
diff
changeset
|
97 |
0 | 98 return TRUE; |
99 } | |
100 | |
101 | |
102 const char patNoteTable[12][3] = | |
103 { | |
104 "C-", "C#", "D-", | |
105 "D#", "E-", "F-", | |
106 "F#", "G-", "G#", | |
107 "A-", "A#", "B-" | |
108 }; | |
109 | |
1200 | 110 |
111 #define jmpNMODEffectTable (36) | |
0 | 112 static const char jmpMODEffectTable[jmpNMODEffectTable] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; |
113 | |
114 | |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
115 void printEscaped(FILE *f, const char *str) |
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
116 { |
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
117 while (*str) |
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
118 { |
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
119 fputc(isprint(*str) ? *str : '*', f); |
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
120 str++; |
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
121 } |
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
122 } |
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
123 |
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
124 |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
125 const char *getNote(const int note) |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
126 { |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
127 static char tmp[16]; |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
128 snprintf(tmp, sizeof(tmp), "%s%d", |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
129 patNoteTable[note % 12], note / 12); |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
130 return tmp; |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
131 } |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
132 |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
133 |
0 | 134 /* Print a given pattern |
135 */ | |
136 void printPattern(FILE *f, JSSPattern *p) | |
137 { | |
138 int i, j; | |
139 char c; | |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
140 JSSNote *n = p->data; |
0 | 141 |
142 for (i = 0; i < p->nrows; i++) | |
143 { | |
144 fprintf(f, "%.2x: ", i); | |
145 | |
146 for (j = 0; j < p->nchannels; j++) | |
147 { | |
148 switch (n->note) | |
149 { | |
150 case jsetNotSet: | |
151 fprintf(f, "... "); | |
152 break; | |
153 case jsetNoteOff: | |
154 fprintf(f, "=== "); | |
155 break; | |
156 default: | |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
157 fprintf(f, "%s ", getNote(n->note)); |
0 | 158 break; |
159 } | |
160 | |
161 if (n->instrument != jsetNotSet) | |
162 fprintf(f, "%.2x ", n->instrument + 1); // Because FT2 is 1-based and we use 0 internally | |
163 else | |
164 fprintf(f, ".. "); | |
1235
5b8245e5f785
Remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1200
diff
changeset
|
165 |
0 | 166 if (n->volume == jsetNotSet) |
167 fprintf(f, ".. "); | |
168 else if (n->volume >= 0x00 && n->volume <= 0x40) | |
169 fprintf(f, "%.2x ", n->volume); | |
170 else | |
171 { | |
172 switch (n->volume & 0xf0) | |
173 { | |
174 case 0x50: c = '-'; break; | |
175 case 0x60: c = '+'; break; | |
176 case 0x70: c = '/'; break; | |
177 case 0x80: c = '\\'; break; | |
178 case 0x90: c = 'S'; break; | |
179 case 0xa0: c = 'V'; break; | |
180 case 0xb0: c = 'P'; break; | |
181 case 0xc0: c = '<'; break; | |
182 case 0xd0: c = '>'; break; | |
183 case 0xe0: c = 'M'; break; | |
184 default: c = '?'; break; | |
185 } | |
186 fprintf(f, "%c%x ", c, (n->volume & 0x0f)); | |
187 } | |
1235
5b8245e5f785
Remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1200
diff
changeset
|
188 |
0 | 189 if (n->effect >= 0 && n->effect < jmpNMODEffectTable) |
190 fprintf(f, "%c", jmpMODEffectTable[n->effect]); | |
191 else if (n->effect == jsetNotSet) | |
192 fprintf(f, "."); | |
193 else | |
194 fprintf(f, "?"); | |
195 | |
196 if (n->param != jsetNotSet) | |
197 fprintf(f, "%.2x|", n->param); | |
198 else | |
199 fprintf(f, "..|"); | |
200 | |
201 n++; | |
202 } | |
203 | |
204 fprintf(f, "\n"); | |
205 } | |
206 } | |
207 | |
208 | |
209 /* | |
210 * Print given extended instrument | |
211 */ | |
1112
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
212 void printEnvelope(FILE *f, JSSEnvelope *e, const char *name) |
0 | 213 { |
214 int i; | |
215 | |
216 fprintf(f, | |
1112
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
217 " %s-envelope:\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
218 " flags......: %.4x%s%s%s\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
219 " npoints....: %d\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
220 " sustain....: %d\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
221 " loop.......: %d - %d\n", |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
222 name, e->flags, |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
223 (e->flags & jenvfUsed) ? " [used]" : "", |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
224 (e->flags & jenvfSustain) ? " [sust]" : "", |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
225 (e->flags & jenvfLooped) ? " [loop]" : "", |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
226 e->npoints, e->sustain, |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
227 e->loopS, e->loopE); |
0 | 228 |
229 if (dmVerbosity >= 2) | |
230 { | |
1112
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
231 fprintf(f, |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
232 " Points.....:"); |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
233 |
0 | 234 for (i = 0; i < e->npoints; i++) |
235 { | |
236 fprintf(f, " [%i:%i]", | |
237 e->points[i].frame, e->points[i].value); | |
238 } | |
239 | |
240 fprintf(f, "\n"); | |
241 } | |
242 } | |
243 | |
244 | |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
245 void printExtInstrument(FILE *f, JSSExtInstrument *inst) |
0 | 246 { |
247 #ifndef JSS_LIGHT | |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
248 if (inst->desc && !optDump) |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
249 { |
1112
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
250 fprintf(f, "'"); |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
251 printEscaped(f, inst->desc); |
1112
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
252 fprintf(f, "'"); |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
253 } |
0 | 254 #endif |
255 fprintf(f, | |
1112
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
256 "\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
257 " nsamples.......: %i\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
258 " vibratoType....: %i\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
259 " vibratoSweep...: %i\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
260 " vibratoDepth...: %i\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
261 " vibratoRate....: %i\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
262 " fadeOut........: %i\n", |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
263 inst->nsamples, inst->vibratoType, inst->vibratoSweep, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
264 inst->vibratoDepth, inst->vibratoRate, inst->fadeOut); |
0 | 265 |
266 if (dmVerbosity >= 1) | |
267 { | |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
268 printEnvelope(f, &inst->volumeEnv, "Volume"); |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
269 printEnvelope(f, &inst->panningEnv, "Panning"); |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
270 } |
1235
5b8245e5f785
Remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1200
diff
changeset
|
271 |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
272 if (dmVerbosity >= 2) |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
273 { |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
274 int n; |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
275 fprintf(f, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
276 " sNumForNotes: "); |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
277 for (n = 0; n < jsetNNotes; n++) |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
278 { |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
279 int snum = inst->sNumForNotes[n]; |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
280 if (snum != jsetNotSet) |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
281 { |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
282 fprintf(f, "%s:%d ", getNote(n), snum); |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
283 } |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
284 } |
0 | 285 } |
286 fprintf(f, "\n"); | |
287 } | |
288 | |
289 | |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
290 void printInstrument(FILE *f, JSSInstrument *inst) |
0 | 291 { |
292 if (dmVerbosity >= 1) | |
293 { | |
294 #ifndef JSS_LIGHT | |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
295 if (inst->desc && !optDump) |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
296 { |
1112
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
297 fprintf(f, "'"); |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
298 printEscaped(f, inst->desc); |
1112
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
299 fprintf(f, "'"); |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
300 } |
0 | 301 #endif |
302 fprintf(f, | |
1112
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
303 "\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
304 " size...........: %ld (0x%lx)\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
305 " loop...........: %ld - %ld (0x%lx - 0x%lx)\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
306 " volume.........: %d (0x%x)\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
307 " flags..........: 0x%x %s%s%s\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
308 " C4BaseSpeed....: %d (0x%x)\n" |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
309 " ERelNote.......: %s (%d)\n" |
1112
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
310 " EFineTune......: %d\n" |
14bd24790929
Various improvements in dumpmod output.
Matti Hamalainen <ccr@tnsp.org>
parents:
1110
diff
changeset
|
311 " EPanning.......: %d (0x%x)\n\n", |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
312 (unsigned long) inst->size, (unsigned long) inst->size, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
313 (unsigned long) inst->loopS, (unsigned long) inst->loopE, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
314 (unsigned long) inst->loopS, (unsigned long) inst->loopE, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
315 inst->volume, inst->volume, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
316 inst->flags, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
317 (inst->flags & jsfLooped) ? "[loop]" : "", |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
318 (inst->flags & jsfBiDi) ? "[bi-di]" : "", |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
319 (inst->flags & jsf16bit) ? "[16 bit]" : "[8 bit]", |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
320 inst->C4BaseSpeed, inst->C4BaseSpeed, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
321 getNote(inst->ERelNote + 48), inst->ERelNote, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
322 inst->EFineTune, inst->EPanning, inst->EPanning); |
0 | 323 } |
324 else | |
325 { | |
326 #ifndef JSS_LIGHT | |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
327 if (inst->desc && !optDump) |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
328 { |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
329 printEscaped(f, inst->desc); |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
330 fprintf(f, "|"); |
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
331 } |
0 | 332 #endif |
333 fprintf(f, | |
1092
03322ee5bb32
Change dumpmod short format sample instrument output.
Matti Hamalainen <ccr@tnsp.org>
parents:
958
diff
changeset
|
334 "%8ld|%8ld..%-8ld|%03d|%-2s %-2s %-2s|" |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
335 "%4d|%s%d|%4d|%4d\n", |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
336 (unsigned long) inst->size, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
337 (unsigned long) inst->loopS, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
338 (unsigned long) inst->loopE, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
339 inst->volume, |
1092
03322ee5bb32
Change dumpmod short format sample instrument output.
Matti Hamalainen <ccr@tnsp.org>
parents:
958
diff
changeset
|
340 |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
341 (inst->flags & jsfLooped) ? "lp" : "", |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
342 (inst->flags & jsfBiDi) ? "bi" : "", |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
343 (inst->flags & jsf16bit) ? "16" : "8", |
1092
03322ee5bb32
Change dumpmod short format sample instrument output.
Matti Hamalainen <ccr@tnsp.org>
parents:
958
diff
changeset
|
344 |
1117
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
345 inst->C4BaseSpeed, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
346 patNoteTable[(48 + inst->ERelNote) % 12], |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
347 (48 + inst->ERelNote) / 12, inst->EFineTune, |
378e5914be1e
Improve dumpmod output some more.
Matti Hamalainen <ccr@tnsp.org>
parents:
1112
diff
changeset
|
348 inst->EPanning); |
0 | 349 } |
350 } | |
351 | |
352 | |
353 void printGeneralInfo(FILE *f, JSSModule *m) | |
354 { | |
355 int i; | |
1235
5b8245e5f785
Remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1200
diff
changeset
|
356 |
0 | 357 if (!m) |
358 return; | |
359 | |
795 | 360 if (!optDump) |
361 { | |
0 | 362 fprintf(f, "Module type.....: %i\n", m->moduleType); |
363 #ifndef JSS_LIGHT | |
364 if (m->moduleName) | |
365 fprintf(f, "Module name.....: '%s'\n", m->moduleName); | |
366 if (m->trackerName) | |
367 fprintf(f, "Tracker name....: '%s'\n", m->trackerName); | |
368 #endif | |
795 | 369 } |
0 | 370 fprintf(f, |
371 "Speed...........: %d ticks\n" | |
372 "Tempo...........: %d bpm\n" | |
373 "Flags...........: %x ", | |
374 m->defSpeed, m->defTempo, m->defFlags); | |
1235
5b8245e5f785
Remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1200
diff
changeset
|
375 |
0 | 376 if (m->defFlags & jmdfAmigaPeriods) fprintf(f, "[Amiga periods] "); |
377 if (m->defFlags & jmdfAmigaLimits) fprintf(f, "[Amiga limits] "); | |
378 if (m->defFlags & jmdfStereo) fprintf(f, "[stereo] "); | |
379 if (m->defFlags & jmdfFT2Replay) fprintf(f, "[FT2 replay] "); | |
380 if (m->defFlags & jmdfST300Slides) fprintf(f, "[ST300 slides] "); | |
381 if (m->defFlags & jmdfByteLStart) fprintf(f, "[ByteStart] "); | |
1235
5b8245e5f785
Remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1200
diff
changeset
|
382 |
0 | 383 fprintf(f, "\n" |
384 "Restart pos.....: %d (order)\n" | |
385 "IntVersion......: %x\n" | |
386 "Channels........: %d\n" | |
387 "Instruments.....: %d\n" | |
388 "Ext.instruments.: %d\n" | |
389 "Patterns........: %d\n" | |
390 "Orders..........: %d\n", | |
391 m->defRestartPos, m->intVersion, m->nchannels, | |
392 m->ninstruments, m->nextInstruments, m->npatterns, | |
393 m->norders); | |
394 | |
395 if (dmVerbosity >= 1) | |
396 { | |
397 fprintf(f, "Orderlist: "); | |
398 for (i = 0; i < m->norders - 1; i++) | |
399 fprintf(f, "%d, ", m->orderList[i]); | |
400 if (i < m->norders) | |
401 fprintf(f, "%d", m->orderList[i]); | |
402 fprintf(f, "\n"); | |
403 } | |
404 } | |
405 | |
406 | |
407 | |
408 int main(int argc, char *argv[]) | |
409 { | |
410 int result = -1, i; | |
777
ed60a7ee3ebb
Change JSSMOD loader to use DMResources.
Matti Hamalainen <ccr@tnsp.org>
parents:
730
diff
changeset
|
411 DMResource *file = NULL; |
ed60a7ee3ebb
Change JSSMOD loader to use DMResources.
Matti Hamalainen <ccr@tnsp.org>
parents:
730
diff
changeset
|
412 JSSModule *mod = NULL; |
0 | 413 |
942
38cad00b41dd
Rename viewmod utility to dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
860
diff
changeset
|
414 dmInitProg("dumpmod", "miniJSS Module Viewer", "0.4", NULL, NULL); |
0 | 415 dmVerbosity = 0; |
416 | |
417 // Parse arguments | |
418 if (!dmArgsProcess(argc, argv, optList, optListN, | |
860
daebbf28953d
The argument handling API in dmargs* was synced with th-libs.
Matti Hamalainen <ccr@tnsp.org>
parents:
797
diff
changeset
|
419 argHandleOpt, argHandleFile, OPTH_BAILOUT)) |
0 | 420 exit(1); |
421 | |
422 // Initialize miniJSS | |
423 jssInit(); | |
424 | |
425 // Open the file | |
426 dmMsg(1, "Reading module file '%s'\n", optFilename); | |
427 if (optFilename == NULL) | |
730
3d813c81f33c
More work on resources API.
Matti Hamalainen <ccr@tnsp.org>
parents:
652
diff
changeset
|
428 result = dmf_create_stdio_stream(stdin, &file); |
3d813c81f33c
More work on resources API.
Matti Hamalainen <ccr@tnsp.org>
parents:
652
diff
changeset
|
429 else |
3d813c81f33c
More work on resources API.
Matti Hamalainen <ccr@tnsp.org>
parents:
652
diff
changeset
|
430 result = dmf_create_stdio(optFilename, "rb", &file); |
1235
5b8245e5f785
Remove trailing whitespace.
Matti Hamalainen <ccr@tnsp.org>
parents:
1200
diff
changeset
|
431 |
730
3d813c81f33c
More work on resources API.
Matti Hamalainen <ccr@tnsp.org>
parents:
652
diff
changeset
|
432 if (result != DMERR_OK) |
0 | 433 { |
958
985225a93aeb
Add error code parameter to dmError() and dmErrorVA().
Matti Hamalainen <ccr@tnsp.org>
parents:
942
diff
changeset
|
434 dmErrorMsg("Error opening input file '%s', #%d: %s\n", |
730
3d813c81f33c
More work on resources API.
Matti Hamalainen <ccr@tnsp.org>
parents:
652
diff
changeset
|
435 optFilename, result, dmErrorStr(result)); |
0 | 436 return 1; |
437 } | |
438 | |
439 // Read module file | |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
440 dmMsg(1, "Reading file: %s\n", optFilename); |
0 | 441 #ifdef JSS_SUP_XM |
797
f066e9dccf29
Oops, fix some inverted booleans.
Matti Hamalainen <ccr@tnsp.org>
parents:
796
diff
changeset
|
442 result = jssLoadXM(file, &mod, TRUE); |
0 | 443 #endif |
444 #ifdef JSS_SUP_JSSMOD | |
1199
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
445 dmfreset(file); |
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
446 if (result != DMERR_OK) |
0 | 447 { |
777
ed60a7ee3ebb
Change JSSMOD loader to use DMResources.
Matti Hamalainen <ccr@tnsp.org>
parents:
730
diff
changeset
|
448 dmMsg(1, "* Trying JSSMOD ...\n"); |
796 | 449 result = jssLoadJSSMOD(file, &mod, TRUE); |
1199
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
450 dmfreset(file); |
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
451 if (result == DMERR_OK) |
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
452 result = jssLoadJSSMOD(file, &mod, FALSE); |
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
453 } |
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
454 else |
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
455 { |
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
456 dmMsg(2, "* Trying XM...\n"); |
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
457 result = jssLoadXM(file, &mod, FALSE); |
0 | 458 } |
459 #endif | |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
460 dmf_close(file); |
1199
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
461 |
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
462 // Check for errors, we still might have some data tho |
8
fc097f7717df
Fix JSSMod loading in viewmod and testpl.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
463 if (result != DMERR_OK) |
0 | 464 { |
958
985225a93aeb
Add error code parameter to dmError() and dmErrorVA().
Matti Hamalainen <ccr@tnsp.org>
parents:
942
diff
changeset
|
465 dmErrorMsg("Error loading module file, %d: %s\n", |
8
fc097f7717df
Fix JSSMod loading in viewmod and testpl.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
466 result, dmErrorStr(result)); |
1199
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
467 } |
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
468 |
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
469 // Check if we have anything |
a79edf59d5d8
Improve use of probing in dumpmod, mod2wav and ppl.
Matti Hamalainen <ccr@tnsp.org>
parents:
1169
diff
changeset
|
470 if (mod == NULL) |
0 | 471 return 3; |
472 | |
473 // Print out information | |
474 if (optViewGeneralInfo) | |
79
d6c2efa25aa4
Oops, missed one s/m/mod/ .. fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
77
diff
changeset
|
475 printGeneralInfo(stdout, mod); |
0 | 476 |
477 if (optViewPatterns) | |
478 { | |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
479 for (i = 0; i < mod->npatterns; i++) |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
480 if (mod->patterns[i] != NULL) |
0 | 481 { |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
482 printf("\nPattern #%02x:\n", i); |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
483 printPattern(stdout, mod->patterns[i]); |
0 | 484 } |
485 } | |
486 | |
487 if (optViewExtInstruments) | |
488 { | |
489 printf("\n" | |
490 "ExtInstruments:\n" | |
491 "---------------\n" | |
492 ); | |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
493 for (i = 0; i < mod->nextInstruments; i++) |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
494 if (mod->extInstruments[i] != NULL) |
0 | 495 { |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
496 printf("#%02x: ", i + 1); |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
497 printExtInstrument(stdout, mod->extInstruments[i]); |
0 | 498 } |
499 } | |
500 | |
501 if (optViewInstruments) | |
502 { | |
503 printf("\n" | |
504 "Instruments:\n" | |
505 "------------\n" | |
506 ); | |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
507 for (i = 0; i < mod->ninstruments; i++) |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
508 if (mod->instruments[i] != NULL) |
0 | 509 { |
1110
ea2cc4932714
Improve output of dumpmod.
Matti Hamalainen <ccr@tnsp.org>
parents:
1092
diff
changeset
|
510 printf("#%02x: ", i + 1); |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
511 printInstrument(stdout, mod->instruments[i]); |
0 | 512 } |
513 } | |
514 | |
515 // Free module data | |
77
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
516 jssFreeModule(mod); |
c6cdaa675801
Add the file mode parameter to dmf_create_stdio() calls, and throw in some
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
517 jssClose(); |
0 | 518 |
519 exit(0); | |
520 return 0; | |
521 } |