diff --git a/polymer/eduke32/build/include/compat.h b/polymer/eduke32/build/include/compat.h index ca4c8898f..044c679fd 100644 --- a/polymer/eduke32/build/include/compat.h +++ b/polymer/eduke32/build/include/compat.h @@ -146,6 +146,11 @@ static inline float nearbyintf(float x) # endif # define B_ENDIAN_C_INLINE 1 +#elif defined(GEKKO) +# define B_LITTLE_ENDIAN 0 +# define B_BIG_ENDIAN 1 +# define B_ENDIAN_C_INLINE 1 + #elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) # include # if _BYTE_ORDER == _LITTLE_ENDIAN diff --git a/polymer/eduke32/build/src/kplib.c b/polymer/eduke32/build/src/kplib.c index a22da126f..b049ade38 100644 --- a/polymer/eduke32/build/src/kplib.c +++ b/polymer/eduke32/build/src/kplib.c @@ -38,7 +38,7 @@ credits. #include #include -#if defined(__POWERPC__) +#if defined(__POWERPC__) || defined(GEKKO) #define BIGENDIAN 1 #endif diff --git a/polymer/eduke32/build/src/lzwnew.c b/polymer/eduke32/build/src/lzwnew.c index 89a9053e1..910974e37 100644 --- a/polymer/eduke32/build/src/lzwnew.c +++ b/polymer/eduke32/build/src/lzwnew.c @@ -1,6 +1,6 @@ //-------------------------------------------------------------------------------------------------- #include "compat.h" -#if defined(__POWERPC__) +#if defined(__POWERPC__) || defined(GEKKO) static uint32_t LSWAPIB(uint32_t a) { return(((a>>8)&0xff00)+((a&0xff00)<<8)+(a<<24)+(a>>24)); } static uint16_t SSWAPIB(uint16_t a) { return((a>>8)+(a<<8)); } #else diff --git a/polymer/eduke32/source/jaudiolib/src/_multivc.h b/polymer/eduke32/source/jaudiolib/src/_multivc.h index eb9f4c5ab..c8e770c31 100644 --- a/polymer/eduke32/source/jaudiolib/src/_multivc.h +++ b/polymer/eduke32/source/jaudiolib/src/_multivc.h @@ -310,7 +310,7 @@ extern const int16_t *MV_RightVolume; extern int32_t MV_SampleSize; extern int32_t MV_RightChannelOffset; -#ifdef __POWERPC__ +#if defined __POWERPC__ || defined GEKKO # define BIGENDIAN #endif diff --git a/polymer/eduke32/source/jaudiolib/src/fx_man.c b/polymer/eduke32/source/jaudiolib/src/fx_man.c index 4fc5692b7..02529ac58 100644 --- a/polymer/eduke32/source/jaudiolib/src/fx_man.c +++ b/polymer/eduke32/source/jaudiolib/src/fx_man.c @@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "multivoc.h" #include "fx_man.h" -#ifdef __POWERPC__ +#if defined __POWERPC__ || defined GEKKO #define LITTLE16(s) (((uint16_t)(s) >> 8) | ((uint16_t)(s) << 8)) #define LITTLE32(s) ((uint32_t)(s) >> 24) | ((uint32_t)(s) << 24) | (((uint32_t)(s)&0xff00) << 8) | (((uint32_t)(s) & 0xff0000) >> 8) #else @@ -930,7 +930,7 @@ int32_t FX_PlayAuto(char *ptr, uint32_t length, int32_t pitchoffset, int32_t vol { int32_t handle = -1; - switch (*(int32_t *)ptr) + switch (LITTLE32(*(int32_t *)ptr)) { case 'C'+('r'<<8)+('e'<<16)+('a'<<24): handle = MV_PlayVOC(ptr, length, pitchoffset, vol, left, right, priority, callbackval); @@ -939,10 +939,12 @@ int32_t FX_PlayAuto(char *ptr, uint32_t length, int32_t pitchoffset, int32_t vol handle = MV_PlayWAV(ptr, length, pitchoffset, vol, left, right, priority, callbackval); break; case 'O'+('g'<<8)+('g'<<16)+('S'<<24): +#ifndef GEKKO handle = MV_PlayVorbis(ptr, length, pitchoffset, vol, left, right, priority, callbackval); +#endif break; default: - switch (*(int32_t *)(ptr + 8)) + switch (LITTLE32(*(int32_t *)(ptr + 8))) { case 'W'+('A'<<8)+('V'<<16)+('E'<<24): handle = MV_PlayWAV(ptr, length, pitchoffset, vol, left, right, priority, callbackval); @@ -985,21 +987,23 @@ int32_t FX_PlayLoopedAuto(char *ptr, uint32_t length, int32_t loopstart, int32_t printf("FX_PlayLoopedAuto %s\n",(char *)fmtstr); } #endif - switch (*(int32_t *)ptr) + switch (LITTLE32(*(int32_t *)ptr)) { - case LITTLE32('C'+('r'<<8)+('e'<<16)+('a'<<24)): + case 'C'+('r'<<8)+('e'<<16)+('a'<<24): handle = MV_PlayLoopedVOC(ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval); break; - case LITTLE32('R'+('I'<<8)+('F'<<16)+('F'<<24)): + case 'R'+('I'<<8)+('F'<<16)+('F'<<24): handle = MV_PlayLoopedWAV(ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval); break; - case LITTLE32('O'+('g'<<8)+('g'<<16)+('S'<<24)): + case 'O'+('g'<<8)+('g'<<16)+('S'<<24): +#ifndef GEKKO handle = MV_PlayLoopedVorbis(ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval); +#endif break; default: - switch (*(int32_t *)(ptr + 8)) + switch (LITTLE32(*(int32_t *)(ptr + 8))) { - case LITTLE32('W'+('A'<<8)+('V'<<16)+('E'<<24)): + case 'W'+('A'<<8)+('V'<<16)+('E'<<24): handle = MV_PlayLoopedWAV(ptr, length, loopstart, loopend, pitchoffset, vol, left, right, priority, callbackval); break; } @@ -1026,21 +1030,23 @@ int32_t FX_PlayAuto3D(char *ptr, uint32_t length, int32_t pitchoffset, int32_t a { int32_t handle = -1; - switch (*(int32_t *)ptr) + switch (LITTLE32(*(int32_t *)ptr)) { - case LITTLE32('C'+('r'<<8)+('e'<<16)+('a'<<24)): // Crea + case 'C'+('r'<<8)+('e'<<16)+('a'<<24): // Crea handle = MV_PlayVOC3D(ptr, length, pitchoffset, angle, distance, priority, callbackval); break; - case LITTLE32('R'+('I'<<8)+('F'<<16)+('F'<<24)): // RIFF + case 'R'+('I'<<8)+('F'<<16)+('F'<<24): // RIFF handle = MV_PlayWAV3D(ptr, length, pitchoffset, angle, distance, priority, callbackval); break; - case LITTLE32('O'+('g'<<8)+('g'<<16)+('S'<<24)): // OggS + case 'O'+('g'<<8)+('g'<<16)+('S'<<24): // OggS +#ifndef GEKKO handle = MV_PlayVorbis3D(ptr, length, pitchoffset, angle, distance, priority, callbackval); +#endif break; default: - switch (*(int32_t *)(ptr + 8)) + switch (LITTLE32(*(int32_t *)(ptr + 8))) { - case LITTLE32('W'+('A'<<8)+('V'<<16)+('E'<<24)): // WAVE + case 'W'+('A'<<8)+('V'<<16)+('E'<<24): // WAVE handle = MV_PlayWAV3D(ptr, length, pitchoffset, angle, distance, priority, callbackval); break; } diff --git a/polymer/eduke32/source/jaudiolib/src/mix.c b/polymer/eduke32/source/jaudiolib/src/mix.c index 0c06af846..592e38af4 100644 --- a/polymer/eduke32/source/jaudiolib/src/mix.c +++ b/polymer/eduke32/source/jaudiolib/src/mix.c @@ -282,7 +282,7 @@ void MV_16BitReverb( char *src, char *dest, VOLUME16 *volume, int32_t count ) do { sample0 = *input; -#ifdef BIGENDIAN +#if 0 //def BIGENDIAN sample0l = sample0 >> 8; sample0h = (sample0 & 255) ^ 128; #else diff --git a/polymer/eduke32/source/jaudiolib/src/multivoc.c b/polymer/eduke32/source/jaudiolib/src/multivoc.c index babf05bb1..503b52c8d 100644 --- a/polymer/eduke32/source/jaudiolib/src/multivoc.c +++ b/polymer/eduke32/source/jaudiolib/src/multivoc.c @@ -334,8 +334,10 @@ static void MV_StopVoice(VoiceNode *voice) RestoreInterrupts(); +#ifndef GEKKO if (voice->wavetype == Vorbis) MV_ReleaseVorbisVoice(voice); +#endif voice->handle = 0; } @@ -456,10 +458,10 @@ static void MV_ServiceVoc(void) //MV_StopVoice( voice ); LL_Remove(voice, next, prev); LL_Add((VoiceNode*) &VoicePool, voice, next, prev); - +#ifndef GEKKO if (voice->wavetype == Vorbis) MV_ReleaseVorbisVoice(voice); - +#endif voice->handle = 0; if (MV_CallBackFunc)