src/audio/SDL_mixer.c
changeset 574 64fe373be3dc
parent 539 a9e38f3b8e4d
child 633 873c2598f969
equal deleted inserted replaced
573:6c3fa3b5e397 574:64fe373be3dc
    34 #include "SDL_audio.h"
    34 #include "SDL_audio.h"
    35 #include "SDL_mutex.h"
    35 #include "SDL_mutex.h"
    36 #include "SDL_timer.h"
    36 #include "SDL_timer.h"
    37 #include "SDL_sysaudio.h"
    37 #include "SDL_sysaudio.h"
    38 #include "SDL_mixer_MMX.h"
    38 #include "SDL_mixer_MMX.h"
       
    39 #include "SDL_mixer_MMX_VC.h"
    39 
    40 
    40 /* Function to check the CPU flags */
    41 /* Function to check the CPU flags */
    41 #define MMX_CPU		0x800000
    42 #define MMX_CPU		0x800000
    42 #ifdef USE_ASMBLIT
    43 #ifdef USE_ASMBLIT
    43 #define CPU_Flags()	Hermes_X86_CPU()
    44 #define CPU_Flags()	Hermes_X86_CPU()
   145 			}
   146 			}
   146 		}
   147 		}
   147 		break;
   148 		break;
   148 
   149 
   149 		case AUDIO_S8: {
   150 		case AUDIO_S8: {
   150 
       
   151 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
   151 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
   152 			if (CPU_Flags() & MMX_CPU)
   152 			if (CPU_Flags() & MMX_CPU)
   153 			{
   153 			{
   154 				SDL_MixAudio_MMX_S8((char*)dst,(char*)src,(unsigned int)len,(int)volume);
   154 				SDL_MixAudio_MMX_S8((char*)dst,(char*)src,(unsigned int)len,(int)volume);
       
   155 			}
       
   156 			else
       
   157 #endif
       
   158 #if defined(USE_ASM_MIXER_VC)
       
   159 			if (SDL_IsMMX_VC())
       
   160 			{
       
   161 				SDL_MixAudio_MMX_S8_VC((char*)dst,(char*)src,(unsigned int)len,(int)volume);
   155 			}
   162 			}
   156 			else
   163 			else
   157 #endif
   164 #endif
   158 			{
   165 			{
   159 			Sint8 *dst8, *src8;
   166 			Sint8 *dst8, *src8;
   186 		case AUDIO_S16LSB: {
   193 		case AUDIO_S16LSB: {
   187 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
   194 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
   188 			if (CPU_Flags() & MMX_CPU)
   195 			if (CPU_Flags() & MMX_CPU)
   189 			{
   196 			{
   190 				SDL_MixAudio_MMX_S16((char*)dst,(char*)src,(unsigned int)len,(int)volume);
   197 				SDL_MixAudio_MMX_S16((char*)dst,(char*)src,(unsigned int)len,(int)volume);
       
   198 			}
       
   199 			else
       
   200 #elif defined(USE_ASM_MIXER_VC)
       
   201 			if (SDL_IsMMX_VC())
       
   202 			{
       
   203 				SDL_MixAudio_MMX_S16_VC((char*)dst,(char*)src,(unsigned int)len,(int)volume);
   191 			}
   204 			}
   192 			else
   205 			else
   193 #endif
   206 #endif
   194 			{
   207 			{
   195 			Sint16 src1, src2;
   208 			Sint16 src1, src2;
   249 		default: /* If this happens... FIXME! */
   262 		default: /* If this happens... FIXME! */
   250 			SDL_SetError("SDL_MixAudio(): unknown audio format");
   263 			SDL_SetError("SDL_MixAudio(): unknown audio format");
   251 			return;
   264 			return;
   252 	}
   265 	}
   253 }
   266 }
       
   267