Replace printf/fprintf with own print_info() / print_error() using SDL_log
[mercenary-reloaded.git] / src / libsound / sound.c
index 9a6f2b1..5b6243a 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdint.h>
 #include <string.h>
 #include <math.h>
+#include "../libsdl/print.h"
 #include "sound.h"
 #include "../libcpu/m68kcpu.h"
 
@@ -62,17 +63,17 @@ static int start_dma(int c, struct audio_channel *chan)
        chan->end = chan->start + chan->length;
        /* check ranges */
        if (chan->length == 0) {
-               fprintf(stderr, "Sample length of channel %d is 0, please fix!\n", c);
+               print_error("Sample length of channel %d is 0, please fix!\n", c);
                chan->dma_on = 0;
                return -1;
        }
        if (chan->pointer >= 0x80000) {
-               fprintf(stderr, "Sample pointer 0x%08x of channel %d is outside memory, please fix!\n", chan->pointer, c);
+               print_error("Sample pointer 0x%08x of channel %d is outside memory, please fix!\n", chan->pointer, c);
                chan->dma_on = 0;
                return -1;
        }
        if (chan->end > 0x80000) {
-               fprintf(stderr, "Sample end (pointer 0x%08x + length 0x%x) of channel %d is outside memory, please fix!\n", chan->pointer, chan->length, c);
+               print_error("Sample end (pointer 0x%08x + length 0x%x) of channel %d is outside memory, please fix!\n", chan->pointer, chan->length, c);
                chan->dma_on = 0;
                return -1;
        }