commit 181363a9147d2e5ffdab18a57bde3e23cf093646
parent 1794c820237504c20188d1c9a7baf9b6283e34e2
Author: Frederic Cambus <fred@statdns.com>
Date: Fri, 22 Feb 2019 09:49:29 +0100
Improve formatting, display 10 values per line.
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/wav2gba.c b/wav2gba.c
@@ -96,14 +96,16 @@ int main(int argc, char *argv[]) {
printf("INPUT FILE: %s (8-bit, MONO, %i Hz)\n", argv[1], wave_header.sample_rate);
printf("OUTPUT FILE: %s\n\n", argv[2]);
- fprintf(output_file, "const s8 %s[] = {\n", argv[3]);
+ fprintf(output_file, "const s8 %s[] = {", argv[3]);
for (size_t loop = 0; loop < input_file_size - WAVE_HEADER_LENGTH; loop++) {
+ if (loop % 10 == 0)
+ fprintf(output_file, "\n\t");
+
fprintf(output_file, "0x%x,", input_file_buffer[WAVE_HEADER_LENGTH + loop] + 128);
}
- fseek(output_file, ftell(output_file)-1, 0);
- fprintf(output_file, "};\n");
+ fprintf(output_file, "\n};\n");
/* Terminate Program */
fclose(output_file);