# HG changeset patch # User Mychaela Falconia # Date 1503705452 0 # Node ID 1f3b28d66d5353ae5b9a11c8344ab45e61347710 # Parent 2568a2a8a4536ec63e7a36210aaecb9660f882d5 tiaud-mkvol program written diff -r 2568a2a8a453 -r 1f3b28d66d53 .hgignore --- a/.hgignore Fri Aug 25 23:36:07 2017 +0000 +++ b/.hgignore Fri Aug 25 23:57:32 2017 +0000 @@ -8,6 +8,7 @@ ^ffstools/cal2text/fc-cal2text$ ^ffstools/tiaud/compile$ ^ffstools/tiaud/decomp$ +^ffstools/tiaud/mkvol$ ^ffstools/tiffs-rd/tiffs$ ^ffstools/tiffs-wrappers/mokoffs$ ^ffstools/tiffs-wrappers/pirffs$ diff -r 2568a2a8a453 -r 1f3b28d66d53 ffstools/tiaud/Makefile --- a/ffstools/tiaud/Makefile Fri Aug 25 23:36:07 2017 +0000 +++ b/ffstools/tiaud/Makefile Fri Aug 25 23:57:32 2017 +0000 @@ -1,6 +1,6 @@ CC= gcc CFLAGS= -O2 -PROGS= compile decomp +PROGS= compile decomp mkvol INSTBIN=/opt/freecalypso/bin all: ${PROGS} @@ -11,10 +11,14 @@ decomp: decomp.c ${CC} ${CFLAGS} -o $@ $@.c +mkvol: mkvol.c + ${CC} ${CFLAGS} -o $@ $@.c + install: ${PROGS} mkdir -p ${INSTBIN} install -c compile ${INSTBIN}/tiaud-compile install -c decomp ${INSTBIN}/tiaud-decomp + install -c mkvol ${INSTBIN}/tiaud-mkvol clean: rm -f ${PROGS} diff -r 2568a2a8a453 -r 1f3b28d66d53 ffstools/tiaud/mkvol.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ffstools/tiaud/mkvol.c Fri Aug 25 23:57:32 2017 +0000 @@ -0,0 +1,39 @@ +/* + * This program generates an audio volume file for uploading into Calypso + * device FFS; TI's Audio Service requires every *.cfg file to be accompanied + * by a corresponding *.vol file. + */ + +#include +#include +#include +#include +#include + +u_char bin[4]; + +write_bin_output(filename) + char *filename; +{ + int fd; + + fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666); + if (fd < 0) { + perror(filename); + exit(1); + } + write(fd, &bin, sizeof bin); + close(fd); +} + +main(argc, argv) + char **argv; +{ + if (argc != 3) { + fprintf(stderr, "usage: %s volume outfile\n", argv[0]); + exit(1); + } + bin[0] = atoi(argv[1]); + write_bin_output(argv[2]); + exit(0); +}