2
0
mirror of https://github.com/arnavbhatt288/sdl-2.30.3-kolibri.git synced 2024-12-22 05:18:50 +01:00

trivial improvements

Signed-off-by: Arnav Bhatt <arnav@ghativega.in>
This commit is contained in:
Arnav Bhatt 2024-06-20 02:25:14 +05:30
parent 7608f7ba6d
commit 74a68f581a
No known key found for this signature in database
GPG Key ID: 2F49C4D36103865D
5 changed files with 29 additions and 14 deletions

View File

@ -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.

View File

@ -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;
}

View File

@ -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"

View File

@ -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;
}

View File

@ -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
{