src/video/SDL_yuv_sw.c
changeset 739 22dbf364c017
parent 366 c94b390687d2
child 769 b8d311d90021
     1.1 --- a/src/video/SDL_yuv_sw.c	Fri Nov 14 20:21:22 2003 +0000
     1.2 +++ b/src/video/SDL_yuv_sw.c	Tue Nov 18 01:27:06 2003 +0000
     1.3 @@ -92,27 +92,11 @@
     1.4  
     1.5  #include "SDL_error.h"
     1.6  #include "SDL_video.h"
     1.7 +#include "SDL_cpuinfo.h"
     1.8  #include "SDL_stretch_c.h"
     1.9  #include "SDL_yuvfuncs.h"
    1.10  #include "SDL_yuv_sw_c.h"
    1.11  
    1.12 -/* Function to check the CPU flags */
    1.13 -#define MMX_CPU		0x800000
    1.14 -#ifdef USE_ASMBLIT
    1.15 -#define CPU_Flags()	Hermes_X86_CPU()
    1.16 -#else
    1.17 -#define CPU_Flags()	0L
    1.18 -#endif
    1.19 -
    1.20 -#ifdef USE_ASMBLIT
    1.21 -#define X86_ASSEMBLER
    1.22 -#define HermesConverterInterface	void
    1.23 -#define HermesClearInterface		void
    1.24 -#define STACKCALL
    1.25 -
    1.26 -#include "HeadX86.h"
    1.27 -#endif
    1.28 -
    1.29  /* The functions used to manipulate software video overlays */
    1.30  static struct private_yuvhwfuncs sw_yuvfuncs = {
    1.31  	SDL_LockYUV_SW,
    1.32 @@ -956,7 +940,7 @@
    1.33  	Uint32 *r_2_pix_alloc;
    1.34  	Uint32 *g_2_pix_alloc;
    1.35  	Uint32 *b_2_pix_alloc;
    1.36 -	int i, cpu_mmx;
    1.37 +	int i;
    1.38  	int CR, CB;
    1.39  	Uint32 Rmask, Gmask, Bmask;
    1.40  
    1.41 @@ -1082,14 +1066,13 @@
    1.42  	switch (format) {
    1.43  	    case SDL_YV12_OVERLAY:
    1.44  	    case SDL_IYUV_OVERLAY:
    1.45 -		cpu_mmx = CPU_Flags() & MMX_CPU;
    1.46  		if ( display->format->BytesPerPixel == 2 ) {
    1.47  #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
    1.48  			/* inline assembly functions */
    1.49 -			if ( cpu_mmx && (Rmask == 0xF800) &&
    1.50 -			                (Gmask == 0x07E0) &&
    1.51 -				        (Bmask == 0x001F) &&
    1.52 -			                (width & 15) == 0) {
    1.53 +			if ( SDL_HasMMX() && (Rmask == 0xF800) &&
    1.54 +			                     (Gmask == 0x07E0) &&
    1.55 +				             (Bmask == 0x001F) &&
    1.56 +			                     (width & 15) == 0) {
    1.57  /*printf("Using MMX 16-bit 565 dither\n");*/
    1.58  				swdata->Display1X = Color565DitherYV12MMX1X;
    1.59  			} else {
    1.60 @@ -1108,10 +1091,10 @@
    1.61  		if ( display->format->BytesPerPixel == 4 ) {
    1.62  #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
    1.63  			/* inline assembly functions */
    1.64 -			if ( cpu_mmx && (Rmask == 0x00FF0000) &&
    1.65 -			                (Gmask == 0x0000FF00) &&
    1.66 -				        (Bmask == 0x000000FF) && 
    1.67 -			                (width & 15) == 0) {
    1.68 +			if ( SDL_HasMMX() && (Rmask == 0x00FF0000) &&
    1.69 +			                     (Gmask == 0x0000FF00) &&
    1.70 +				             (Bmask == 0x000000FF) && 
    1.71 +			                     (width & 15) == 0) {
    1.72  /*printf("Using MMX 32-bit dither\n");*/
    1.73  				swdata->Display1X = ColorRGBDitherYV12MMX1X;
    1.74  			} else {