--- SIDPlayer/src/main_sdl.cpp 2001/01/16 14:12:54 1.4 +++ SIDPlayer/src/main_sdl.cpp 2001/01/16 16:53:26 1.5 @@ -35,7 +35,8 @@ static void usage(const char *prg_name) { - printf("\nUsage: %s [options] FILE [song_number]]\n", prg_name); + printf("Usage: %s [OPTION...] FILE [song_number]]\n", prg_name); + PrefsPrintUsage(); exit(0); } @@ -50,7 +51,7 @@ int main(int argc, char **argv) // Print banner printf( PACKAGE " Version " VERSION "\n\n" - "Copyright (C) 1996-2000 Christian Bauer\n" + "Copyright (C) 1996-2001 Christian Bauer\n" "E-mail: Christian.Bauer@uni-mainz.de\n" "http://www.uni-mainz.de/~bauec002/\n\n" "This is free software with ABSOLUTELY NO WARRANTY.\n" @@ -58,7 +59,16 @@ int main(int argc, char **argv) "For details, see the file COPYING.\n\n" ); - // Parse arguments + // Initialize everything + if (SDL_Init(SDL_INIT_AUDIO) < 0) { + fprintf(stderr, "Couldn't initialize SDL (%s)\n", SDL_GetError()); + exit(1); + } + atexit(quit); + InitAll(argc, argv); + int32 selected_speed = PrefsFindInt32("speed"); + + // Parse non-option arguments if (argc < 2) usage(argv[0]); char *file_name = argv[argc - 1]; @@ -76,14 +86,6 @@ int main(int argc, char **argv) } } - // Initialize everything - if (SDL_Init(SDL_INIT_AUDIO) < 0) { - fprintf(stderr, "Couldn't initialize SDL (%s)\n", SDL_GetError()); - exit(1); - } - atexit(quit); - InitAll(argc, argv); - // Load given PSID file if (!LoadPSIDFile(file_name)) { fprintf(stderr, "Couldn't load '%s' (not a PSID file?)\n", file_name); @@ -104,7 +106,7 @@ int main(int argc, char **argv) printf("Playing song %d/%d\n", current_song + 1, number_of_songs); // Start replay and enter main loop - SIDAdjustSpeed(PrefsFindInt32("speed")); + SIDAdjustSpeed(selected_speed); // SelectSong resets this to 100% SDL_PauseAudio(false); while (true) { SDL_Event e;