print out tune size

This commit is contained in:
twobit 2012-08-09 15:30:39 +02:00
parent d2fa333ec7
commit 6382b42b30

View File

@ -163,8 +163,13 @@ static int parse_tune(const char* filename) {
} }
if(state =! 4) return line_nr; if(state =! 4) return line_nr;
fclose(file); fclose(file);
int size = wave_counter * 2 +
inst_counter * sizeof(synth_instrument_t) +
pattern_counter * pattern_length * 2 +
tune_length * channel_count;
printf("tune size: %d bytes\n", size);
return 0; return 0;
} }
@ -177,12 +182,14 @@ int main(int argc, char** argv) {
return 0; return 0;
} }
puts("parsing...");
int error = parse_tune(argv[1]); int error = parse_tune(argv[1]);
if(error != 0) { if(error != 0) {
fprintf(stderr, "%d: parsing error\n", error); fprintf(stderr, "%d: parsing error\n", error);
return 1; return 1;
} }
spec.callback = &fill_buffer; spec.callback = &fill_buffer;
if(SDL_OpenAudio(&spec, &spec) < 0) { if(SDL_OpenAudio(&spec, &spec) < 0) {
fprintf(stderr, "ERROR"); fprintf(stderr, "ERROR");