reorganized the soundblaster code a bit, adding support for DSP < 4
[dos_auplay] / src / main.c
index 8fa1126..1e17beb 100644 (file)
@@ -12,7 +12,7 @@ static int play_file(const char *fname);
 static int cbfunc(void *buf, int size, void *cls);\r
 static void print_usage(const char *argv0);\r
 \r
-static int vol = 220;\r
+static int vol = 255;\r
 static int quit;\r
 \r
 int main(int argc, char **argv)\r
@@ -22,7 +22,7 @@ int main(int argc, char **argv)
        if(audio_init() == -1) {\r
                return 1;\r
        }\r
-       audio_setvolume(AUDIO_MASTER, vol);\r
+       audio_setvolume(AUDIO_MASTER, 255);\r
        audio_setvolume(AUDIO_PCM, 255);\r
 \r
        for(i=1; i<argc; i++) {\r
@@ -90,7 +90,7 @@ static int play_file(const char *fname)
                                paused = !paused;\r
                                if(paused) {\r
                                        audio_pause();\r
-                                       printf("pause\n");\r
+                                       printf("\npause\n");\r
                                } else {\r
                                        audio_resume();\r
                                        printf("resume\n");\r
@@ -101,14 +101,14 @@ static int play_file(const char *fname)
                                vol += 32;\r
                                if(vol > 255) vol = 255;\r
                                audio_setvolume(AUDIO_DEFAULT, vol);\r
-                               printf("volume: %d%%\n", 101 * vol / 256);\r
+                               printf("\nvolume: %d%%\n", 101 * vol / 256);\r
                                break;\r
 \r
                        case '-':\r
                                vol -= 32;\r
                                if(vol < 0) vol = 0;\r
                                audio_setvolume(AUDIO_DEFAULT, vol);\r
-                               printf("volume: %d%%\n", 101 * vol / 256);\r
+                               printf("\nvolume: %d%%\n", 101 * vol / 256);\r
                                break;\r
 \r
                        case 'm':\r
@@ -130,7 +130,8 @@ static int play_file(const char *fname)
                        prev = dbg_cur_offs;\r
                        _enable();\r
 \r
-                       printf("%3d%% - offs: %lu/%lu\n", 100 * prev / au->size, prev, au->size);\r
+                       printf("%3d%% - offs: %lu/%lu       \r", 100 * prev / au->size, prev, au->size);\r
+                       fflush(stdout);\r
                } else {\r
                        _enable();\r
                }\r
@@ -138,6 +139,7 @@ static int play_file(const char *fname)
        }\r
 \r
 end:\r
+       putchar('\n');\r
        au_close(au);\r
 #ifdef DBG_PRELOAD\r
        free(dbg_samples);\r