diff --git a/Makefile b/Makefile index 751f992..af1ccf9 100755 --- a/Makefile +++ b/Makefile @@ -95,8 +95,8 @@ OBJS = $(atomic_OBJS) $(audio_OBJS) $(cpuinfo_OBJS) $(events_OBJS) $(file_OBJS) CFLAGS = -c -O2 -mpreferred-stack-boundary=2 -fno-ident -fomit-frame-pointer -fno-stack-check \ -fno-stack-protector -mno-stack-arg-probe -fno-exceptions -fno-asynchronous-unwind-tables \ -ffast-math -mno-ms-bitfields -fexpensive-optimizations \ - -D__KOLIBRI__ -D_KOLIBRI -DKOLIBRI -D_KOS_ -D_KOS -DKOS -DPACKAGE=\"SDL\" -DVERSION=\"2.30.3\" \ - -U_Win32 -UWIN32 -U_WIN32 -U__MINGW32__ -U__WIN32__ \ + -D__KOLIBRI__ -D_KOLIBRI -DKOLIBRI -D_KOS_ -D_KOS -DKOS -DDEBUG_AUDIO -DDEBUG_VIDEO \ + -DPACKAGE=\"SDL\" -DVERSION=\"2.30.3\" -U_Win32 -UWIN32 -U_WIN32 -U__MINGW32__ -U__WIN32__ \ -I../newlib/libc/include/ -Iinclude/ -Iatomic/ -Iaudio/ -Icpuinfo/ -Ievents/ -Ifile/ -Ihaptic/ \ -Ihidapi/ -Ijoystick/ -Iloadso/ -Ipower/ -Ifilesystem/ -Ilocale/ -Imisc/ -Irender/ -Isensor/ \ -Istdlib/ -Ilibm/ -Ithread/ -Itimer/ -Ivideo/ -I. diff --git a/src/audio/kolibri/SDL_kolibriaudio.c b/src/audio/kolibri/SDL_kolibriaudio.c index 607b13e..315d8d2 100644 --- a/src/audio/kolibri/SDL_kolibriaudio.c +++ b/src/audio/kolibri/SDL_kolibriaudio.c @@ -1,3 +1,4 @@ + #include "../../SDL_internal.h" #ifdef SDL_AUDIO_DRIVER_KOLIBRI @@ -28,9 +29,7 @@ static void kolibri_audio_callback(void) ksys_signal_info_t snd_signal; SDL_AudioDevice *_this; SDL_AudioCallback callback; - int bPaused; - char str[100]; // initialize _this = global_device; @@ -42,8 +41,13 @@ static void kolibri_audio_callback(void) } GetBufferSize(private->hBuff, &_this->spec.size); - sprintf(str, "buffer created, size is %d\n", _this->spec.size); - _ksys_debug_puts(str); + +#ifdef DEBUG_AUDIO + char *info; + SDL_asprintf(&info, "buffer created, size is %d\n", _this->spec.size); + _ksys_debug_puts(info); + SDL_free(info); +#endif _this->spec.size >>= 1; _this->work_buffer = SDL_malloc(_this->spec.size); @@ -112,7 +116,6 @@ static void KOLIBRIAUDIO_CloseDevice(SDL_AudioDevice *device) static int KOLIBRIAUDIO_OpenDevice(_THIS, const char *devname) { int ver; - char buff[100]; if (InitSound(&ver)) { SDL_SetError("Error: cannot load drivers!\n"); @@ -209,9 +212,12 @@ static int KOLIBRIAUDIO_OpenDevice(_THIS, const char *devname) if (_this->spec.format == AUDIO_U16SYS || _this->spec.format == AUDIO_S16SYS) _this->spec.samples /= 2; - sprintf(buff, "obtained size is %d, samples %d\n", _this->spec.size, _this->spec.samples); - _ksys_debug_puts(buff); - +#ifdef DEBUG_AUDIO + char *info; + SDL_asprintf(&info, "obtained size is %d, samples %d\n", _this->spec.size, _this->spec.samples); + _ksys_debug_puts(info); + SDL_free(info); +#endif return 0; } diff --git a/src/video/kolibri/SDL_kolibrievents.h b/src/video/kolibri/SDL_kolibrievents.h index 93d0d1e..4faf8e6 100644 --- a/src/video/kolibri/SDL_kolibrievents.h +++ b/src/video/kolibri/SDL_kolibrievents.h @@ -1,6 +1,6 @@ -#ifndef SDL_kolibrievents_c_h_ -#define SDL_kolibrievents_c_h_ +#ifndef SDL_kolibrievents_h_ +#define SDL_kolibrievents_h_ #include "../../SDL_internal.h" diff --git a/src/video/kolibri/SDL_kolibriframebuffer.c b/src/video/kolibri/SDL_kolibriframebuffer.c index c13956b..7bb1b49 100644 --- a/src/video/kolibri/SDL_kolibriframebuffer.c +++ b/src/video/kolibri/SDL_kolibriframebuffer.c @@ -40,6 +40,15 @@ int SDL_KOLIBRI_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *forma *format = surface_format; *pixels = surface->pixels; *pitch = surface->pitch; + +#ifdef DEBUG_VIDEO + char *info; + + SDL_asprintf(&info, "width = %d, height = %d, pitch = %d, bpp = %d\n", window->w, + window->h, surface->pitch, surface_format); + _ksys_debug_puts(info); + SDL_free(info); +#endif return 0; } diff --git a/src/video/kolibri/SDL_kolibrivideo.h b/src/video/kolibri/SDL_kolibrivideo.h index 7eecea7..0c872cc 100644 --- a/src/video/kolibri/SDL_kolibrivideo.h +++ b/src/video/kolibri/SDL_kolibrivideo.h @@ -1,6 +1,6 @@ -#ifndef _SDL_kolibri_video_h -#define _SDL_kolibri_video_h +#ifndef SDL_kolibrivideo_h +#define SDL_kolibrivideo_h typedef struct SDL_VideoData {