Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

First commit. Added header configs for DS as well as a Makefile. Init…

…ial work on framebuffer video driver, currently not functioning as desired.
  • Loading branch information
Darren Alton committed Jun 10, 2008
1 parent ec4df7d commit bf7f5eadf2b58cd561aa3e3e2be1230f969f7cda
Showing with 90 additions and 127 deletions.
  1. +3 −1 include/SDL_config.h.default
  2. +5 −0 include/SDL_platform.h
  3. +9 −0 include/SDL_stdinc.h
  4. +2 −4 src/audio/SDL_wave.c
  5. +1 −2 src/audio/bsd/SDL_bsdaudio.c
  6. +1 −2 src/audio/dma/SDL_dmaaudio.c
  7. +2 −3 src/audio/esd/SDL_esdaudio.c
  8. +2 −4 src/audio/nto/SDL_nto_audio.c
  9. +2 −3 src/audio/paudio/SDL_paudio.c
  10. +2 −4 src/audio/ums/SDL_umsaudio.c
  11. +1 −2 src/audio/windib/SDL_dibaudio.c
  12. +5 −10 src/cdrom/aix/SDL_syscdrom.c
  13. +1 −2 src/cdrom/beos/SDL_syscdrom.cc
  14. +1 −2 src/cdrom/bsdi/SDL_syscdrom.c
  15. +1 −2 src/cdrom/freebsd/SDL_syscdrom.c
  16. +1 −2 src/cdrom/linux/SDL_syscdrom.c
  17. +1 −2 src/cdrom/macosx/AudioFilePlayer.c
  18. +1 −2 src/cdrom/macosx/CDPlayer.c
  19. +1 −2 src/cdrom/openbsd/SDL_syscdrom.c
  20. +1 −2 src/cdrom/osf/SDL_syscdrom.c
  21. +2 −4 src/cdrom/qnx/SDL_syscdrom.c
  22. +1 −2 src/main/beos/SDL_BeApp.cc
  23. +2 −0 src/thread/SDL_thread_c.h
  24. +1 −2 src/thread/irix/SDL_syssem.c
  25. +1 −2 src/thread/pthread/SDL_syssem.c
  26. +1 −2 src/thread/riscos/SDL_syssem.c
  27. +1 −2 src/timer/riscos/SDL_systimer.c
  28. +1 −2 src/timer/unix/SDL_systimer.c
  29. +10 −20 src/video/SDL_RLEaccel.c
  30. +3 −0 src/video/SDL_sysvideo.h
  31. +3 −0 src/video/SDL_video.c
  32. +1 −2 src/video/fbcon/SDL_fbelo.c
  33. +3 −5 src/video/fbcon/SDL_fbevents.c
  34. +4 −8 src/video/fbcon/SDL_fbvideo.c
  35. +3 −6 src/video/ipod/SDL_ipodvideo.c
  36. +1 −2 src/video/photon/SDL_phyuv.c
  37. +3 −5 src/video/ps2gs/SDL_gsevents.c
  38. +1 −2 src/video/svga/SDL_svgaevents.c
  39. +1 −2 src/video/vgl/SDL_vglevents.c
  40. +1 −2 src/video/wscons/SDL_wsconsevents.c
  41. +1 −2 test/testblitspeed.c
  42. +1 −2 test/testdyngl.c
  43. +1 −2 test/testpalette.c
@@ -26,7 +26,9 @@
#include "SDL_platform.h"

/* Add any platform that doesn't build using the configure system */
#if defined(__DREAMCAST__)
#if defined(__NINTENDODS__)
#include "SDL_config_nintendods.h"
#elif defined(__DREAMCAST__)
#include "SDL_config_dreamcast.h"
#elif defined(__MACOSX__)
#include "SDL_config_macosx.h"
@@ -97,4 +97,9 @@
#define __WIN32__ 1
#endif

#if defined(__NDS__)
#undef __NINTENDODS__
#define __NINTENDODS__ 1
#endif

#endif /* _SDL_platform_h */
@@ -147,8 +147,12 @@ SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
#ifndef __NINTENDODS__ /* TODO: figure out why the following happens:
include/SDL_stdinc.h:150: error: size of array 'SDL_dummy_uint64' is negative
include/SDL_stdinc.h:151: error: size of array 'SDL_dummy_sint64' is negative */
SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
#endif
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */

/* Check to make sure enums are the size of ints, for structure packing.
@@ -162,12 +166,14 @@ SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
#endif

#ifndef DOXYGEN_SHOULD_IGNORE_THIS
#ifndef __NINTENDODS__ /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */
typedef enum
{
DUMMY_ENUM_VALUE
} SDL_DUMMY_ENUM;

SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int));
#endif
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */

#include "begin_code.h"
@@ -425,6 +431,9 @@ extern DECLSPEC size_t SDLCALL SDL_strlen(const char *string);
#ifdef HAVE_WCSLEN
#define SDL_wcslen wcslen
#else
#if !defined(wchar_t) && defined(__NINTENDODS__)
#define wchar_t short /* TODO: figure out why libnds doesn't have this */
#endif
extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t * string);
#endif

@@ -462,8 +462,7 @@ SDL_LoadWAV_RW(SDL_RWops * src, int freesrc,
}
/* 2 Uint32's for chunk header+len, plus the lenread */
headerDiff += lenread + 2 * sizeof(Uint32);
}
while ((chunk.magic == FACT) || (chunk.magic == LIST));
} while ((chunk.magic == FACT) || (chunk.magic == LIST));

/* Decode the audio data format */
format = (WaveFMT *) chunk.data;
@@ -564,8 +563,7 @@ SDL_LoadWAV_RW(SDL_RWops * src, int freesrc,
*audio_buf = chunk.data;
if (chunk.magic != DATA)
headerDiff += lenread + 2 * sizeof(Uint32);
}
while (chunk.magic != DATA);
} while (chunk.magic != DATA);
headerDiff += 2 * sizeof(Uint32); /* for the data chunk and len */

if (MS_ADPCM_encoded) {
@@ -270,8 +270,7 @@ BSDAUDIO_PlayDevice(_THIS)
|| ((written < 0) && ((errno == 0) || (errno == EAGAIN)))) {
SDL_Delay(1); /* Let a little CPU time go by */
}
}
while (p < written);
} while (p < written);

/* If timer synchronization is enabled, set the next write frame */
if (this->hidden->frame_ticks) {
@@ -498,8 +498,7 @@ DMA_GetDeviceBuf(_THIS)
this->enabled = 0;
return (NULL);
}
}
while (frame_ticks && (info.blocks < 1));
} while (frame_ticks && (info.blocks < 1));
#ifdef DEBUG_AUDIO
if (info.blocks > 1) {
printf("Warning: audio underflow (%d frags)\n", info.blocks - 1);
@@ -154,9 +154,8 @@ ESD_PlayDevice(_THIS)
if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) {
SDL_Delay(1); /* Let a little CPU time go by */
}
}
while ((written < 0) &&
((errno == 0) || (errno == EAGAIN) || (errno == EINTR)));
} while ((written < 0) &&
((errno == 0) || (errno == EAGAIN) || (errno == EINTR)));

/* Set the next write frame */
this->hidden->next_frame += this->hidden->frame_ticks;
@@ -154,8 +154,7 @@ NTO_WaitDevice(_THIS)
}
break;
}
}
while (1);
} while (1);
}

static void
@@ -213,8 +212,7 @@ NTO_PlayDevice(_THIS)
towrite -= written;
pcmbuffer += written * this->spec.channels;
}
}
while ((towrite > 0) && (this->enabled));
} while ((towrite > 0) && (this->enabled));

/* If we couldn't write, assume fatal error for now */
if (towrite != 0) {
@@ -208,9 +208,8 @@ PAUDIO_PlayDevice(_THIS)
if ((written < 0) && ((errno == 0) || (errno == EAGAIN))) {
SDL_Delay(1); /* Let a little CPU time go by */
}
}
while ((written < 0) &&
((errno == 0) || (errno == EAGAIN) || (errno == EINTR)));
} while ((written < 0) &&
((errno == 0) || (errno == EAGAIN) || (errno == EINTR)));

/* If timer synchronization is enabled, set the next write frame */
if (this->hidden->frame_ticks) {
@@ -218,8 +218,7 @@ UMS_PlayAudio(_THIS)
#endif
return;
}
}
while (samplesToWrite > 0);
} while (samplesToWrite > 0);

SDL_LockAudio();
SDL_memcpy(&swpbuf, &this->hidden->playbuf, sizeof(UMSAudioTypes_Buffer));
@@ -326,8 +325,7 @@ UMS_OpenAudio(_THIS, SDL_AudioSpec * spec)
if (!success) {
test_format = SDL_NextAudioFormat();
}
}
while (!success && test_format);
} while (!success && test_format);

if (success == 0) {
SDL_SetError("Couldn't find any hardware audio formats");
@@ -136,8 +136,7 @@ WINWAVEOUT_WaitDone(_THIS)
if (left > 0) {
SDL_Delay(100);
}
}
while (left > 0);
} while (left > 0);
}

void
@@ -181,8 +181,7 @@ CheckMounts()
#endif
return;
}
}
while (ret == 0);
} while (ret == 0);

#ifdef DEBUG_CDROM
fprintf(stderr, "Read %d vmount structures\n", ret);
@@ -211,8 +210,7 @@ CheckMounts()
}
ptr = (struct vmount *) ((char *) ptr + ptr->vmt_length);
ret--;
}
while (ret > 0);
} while (ret > 0);

free(buffer);
}
@@ -247,8 +245,7 @@ CheckNonmounts()
}
}
}
}
while (ret == 0);
} while (ret == 0);
ret = endfsent_r(&fsFile);
if (ret != 0)
return -1;
@@ -275,8 +272,7 @@ CheckNonmounts()
}
}
}
}
while (entry != NULL);
} while (entry != NULL);
endfsent();
#endif
}
@@ -326,8 +322,7 @@ SDL_SYS_CDInit(void)
} else {
SDLcdrom = NULL;
}
}
while (SDLcdrom);
} while (SDLcdrom);
SDL_stack_free(cdpath);
}

@@ -193,8 +193,7 @@ SDL_SYS_CDInit(void)
} else {
SDLcdrom = NULL;
}
}
while (SDLcdrom);
} while (SDLcdrom);
SDL_stack_free(cdpath);
}

@@ -286,8 +286,7 @@ SDL_SYS_CDInit(void)
} else {
SDLcdrom = NULL;
}
}
while (SDLcdrom);
} while (SDLcdrom);
SDL_stack_free(cdpath);
}

@@ -176,8 +176,7 @@ SDL_SYS_CDInit(void)
} else {
SDLcdrom = NULL;
}
}
while (SDLcdrom);
} while (SDLcdrom);
SDL_stack_free(cdpath);
}

@@ -312,8 +312,7 @@ SDL_SYS_CDInit(void)
} else {
SDLcdrom = NULL;
}
}
while (SDLcdrom);
} while (SDLcdrom);
SDL_stack_free(cdpath);
}

@@ -311,8 +311,7 @@ AudioFilePlayer_OpenFile(AudioFilePlayer * afp, const FSRef * inRef,

/* Skip the chunk data */
offset = chunk.ckSize;
}
while (chunk.ckID != 'SSND');
} while (chunk.ckID != 'SSND');

/* Read the header of the SSND chunk. After this, we are positioned right
at the start of the audio data. */
@@ -400,8 +400,7 @@ ListTrackFiles(FSVolumeRefNum theVolume, FSRef * trackFiles, int numTracks)
}
CFRelease(name);
}
}
while (noErr == result);
} while (noErr == result);
FSCloseIterator(iterator);
}

@@ -184,8 +184,7 @@ SDL_SYS_CDInit(void)
} else {
SDLcdrom = NULL;
}
}
while (SDLcdrom);
} while (SDLcdrom);
SDL_stack_free(cdpath);
}

@@ -199,8 +199,7 @@ SDL_SYS_CDInit(void)
} else {
SDLcdrom = NULL;
}
}
while (SDLcdrom);
} while (SDLcdrom);
SDL_stack_free(cdpath);
}

@@ -184,8 +184,7 @@ SDL_SYS_CDInit(void)
} else {
SDLcdrom = NULL;
}
}
while (SDLcdrom);
} while (SDLcdrom);
SDL_stack_free(cdpath);
}

@@ -357,8 +356,7 @@ SDL_SYS_CDStatus(SDL_CD * cdrom, int *position)
devctlret = ENXIO;
break;
}
}
while ((devctlret == EAGAIN) || (devctlret == ESTALE));
} while ((devctlret == EAGAIN) || (devctlret == ESTALE));

if (devctlret != 0) {
if (devctlret == ENXIO) {
@@ -78,8 +78,7 @@ SDL_InitBeApp(void)

do {
SDL_Delay(10);
}
while ((be_app == NULL) || be_app->IsLaunching());
} while ((be_app == NULL) || be_app->IsLaunching());

/* Mark the application active */
SDL_BeAppActive = 0;
@@ -43,6 +43,8 @@
#include "irix/SDL_systhread_c.h"
#elif SDL_THREAD_WIN32
#include "win32/SDL_systhread_c.h"
#elif SDL_THREAD_NDS
#include "nds/SDL_systhread_c.h"
#else
#error Need thread implementation for this platform
#include "generic/SDL_systhread_c.h"
@@ -170,8 +170,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
break;
}
SDL_Delay(1);
}
while (SDL_GetTicks() < timeout);
} while (SDL_GetTicks() < timeout);

return retval;
}
@@ -125,8 +125,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
break;
}
SDL_Delay(1);
}
while (SDL_GetTicks() < timeout);
} while (SDL_GetTicks() < timeout);

return retval;
}
@@ -177,8 +177,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
break;
}
SDL_Delay(1);
}
while (SDL_GetTicks() < timeout);
} while (SDL_GetTicks() < timeout);

return retval;
}
@@ -130,8 +130,7 @@ SDL_Delay(Uint32 ms)
pthread_yield();
#endif

}
while (1);
} while (1);
}

#if SDL_THREADS_DISABLED
@@ -137,8 +137,7 @@ SDL_Delay(Uint32 ms)

was_error = select(0, NULL, NULL, NULL, &tv);
#endif /* HAVE_NANOSLEEP */
}
while (was_error && (errno == EINTR));
} while (was_error && (errno == EINTR));
#endif /* SDL_THREAD_PTH */
}

0 comments on commit bf7f5ea

Please sign in to comment.