Commit 7c6f290b authored by Sam Lantinga's avatar Sam Lantinga

FIXME:

This code needs to be rewritten to reference the static data using relocatable addresses (e.g. http://www.gentoo.org/proj/en/hardened/pic-fix-guide.xml or http://nasm.sourceforge.net/doc/html/nasmdoc8.html#section-8.2)
This code currently breaks on systems with readonly text segments (hardened Linux / Intel Mac)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401417
parent 8b957d57
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
*/ */
#include "SDL_config.h" #include "SDL_config.h"
#if 0 /* FIXME: This code needs to be rewritten to reference the static data using relocatable addresses (e.g. http://www.gentoo.org/proj/en/hardened/pic-fix-guide.xml or http://nasm.sourceforge.net/doc/html/nasmdoc8.html#section-8.2) This code currently breaks on systems with readonly text segments (hardened Linux / Intel Mac) */
#if defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES #if defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES
#include "SDL_stdinc.h" #include "SDL_stdinc.h"
...@@ -406,3 +407,4 @@ void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, ...@@ -406,3 +407,4 @@ void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
} }
#endif /* GCC i386 inline assembly */ #endif /* GCC i386 inline assembly */
#endif /* 0 */
...@@ -121,6 +121,7 @@ struct private_yuvhwdata { ...@@ -121,6 +121,7 @@ struct private_yuvhwdata {
/* The colorspace conversion functions */ /* The colorspace conversion functions */
#if 0 /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES*/
extern void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, extern void Color565DitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
unsigned char *lum, unsigned char *cr, unsigned char *lum, unsigned char *cr,
unsigned char *cb, unsigned char *out, unsigned char *cb, unsigned char *out,
...@@ -129,6 +130,7 @@ extern void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix, ...@@ -129,6 +130,7 @@ extern void ColorRGBDitherYV12MMX1X( int *colortab, Uint32 *rgb_2_pix,
unsigned char *lum, unsigned char *cr, unsigned char *lum, unsigned char *cr,
unsigned char *cb, unsigned char *out, unsigned char *cb, unsigned char *out,
int rows, int cols, int mod ); int rows, int cols, int mod );
#endif
static void Color16DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix, static void Color16DitherYV12Mod1X( int *colortab, Uint32 *rgb_2_pix,
unsigned char *lum, unsigned char *cr, unsigned char *lum, unsigned char *cr,
...@@ -1059,7 +1061,7 @@ SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_S ...@@ -1059,7 +1061,7 @@ SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_S
case SDL_YV12_OVERLAY: case SDL_YV12_OVERLAY:
case SDL_IYUV_OVERLAY: case SDL_IYUV_OVERLAY:
if ( display->format->BytesPerPixel == 2 ) { if ( display->format->BytesPerPixel == 2 ) {
#if defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES #if 0 /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES*/
/* inline assembly functions */ /* inline assembly functions */
if ( SDL_HasMMX() && (Rmask == 0xF800) && if ( SDL_HasMMX() && (Rmask == 0xF800) &&
(Gmask == 0x07E0) && (Gmask == 0x07E0) &&
...@@ -1081,7 +1083,7 @@ SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_S ...@@ -1081,7 +1083,7 @@ SDL_Overlay *SDL_CreateYUV_SW(_THIS, int width, int height, Uint32 format, SDL_S
swdata->Display2X = Color24DitherYV12Mod2X; swdata->Display2X = Color24DitherYV12Mod2X;
} }
if ( display->format->BytesPerPixel == 4 ) { if ( display->format->BytesPerPixel == 4 ) {
#if defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES #if 0 /*defined(__GNUC__) && defined(__i386__) && SDL_ASSEMBLY_ROUTINES*/
/* inline assembly functions */ /* inline assembly functions */
if ( SDL_HasMMX() && (Rmask == 0x00FF0000) && if ( SDL_HasMMX() && (Rmask == 0x00FF0000) &&
(Gmask == 0x0000FF00) && (Gmask == 0x0000FF00) &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment