From 6382b42b3046c0d5312bb4895b2d601d4c06f413 Mon Sep 17 00:00:00 2001 From: twobit Date: Thu, 9 Aug 2012 15:30:39 +0200 Subject: [PATCH] print out tune size --- synth/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/synth/main.c b/synth/main.c index 7ef00bb..ab9c418 100644 --- a/synth/main.c +++ b/synth/main.c @@ -163,8 +163,13 @@ static int parse_tune(const char* filename) { } if(state =! 4) return line_nr; - 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; } @@ -177,12 +182,14 @@ int main(int argc, char** argv) { return 0; } + puts("parsing..."); int error = parse_tune(argv[1]); if(error != 0) { fprintf(stderr, "%d: parsing error\n", error); return 1; } + spec.callback = &fill_buffer; if(SDL_OpenAudio(&spec, &spec) < 0) { fprintf(stderr, "ERROR");