gbaconv

A set of tools aimed at GameBoy Advance developers
Log | Files | Refs | README | LICENSE

commit c940d8a5392c1d7d2c0dfb7c4abfb6628f327acf
parent 6ea7df2f03aa7ffa907f7bf5ebdb16276c62b0ce
Author: Frederic Cambus <fred@statdns.com>
Date:   Thu, 21 Feb 2019 22:08:33 +0100

Avoid doing an addition for each loop step to calculate offset.

Diffstat:
Mwav2gba.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/wav2gba.c b/wav2gba.c @@ -100,8 +100,8 @@ int main(int argc, char *argv[]) { fprintf(output_file, "const s8 %s[] = {\n", argv[3]); - for (loop = 0; loop < input_file_size; loop++) { - fprintf(output_file, "0x%x,", input_file_buffer[WAVE_HEADER_LENGTH+loop]+128); + for (loop = WAVE_HEADER_LENGTH; loop < input_file_size; loop++) { + fprintf(output_file, "0x%x,", input_file_buffer[loop]+128); } fseek(output_file, ftell(output_file)-1, 0);