Hi,
I see the same problem when using my pixel-draw routine (see attached
source code). memset4 segfaults. I am using the stock Mandrake 7.2 and the
1.1.8 lib.
The patch didn’t work with 1.1.8 - can you send me one or a working
routine for manual patching.
Ciao
Andreas—
/* ----- Pixel - using single pixel blit with blending enabled. */
static SDL_Surface *gfxPrimitivesSinglePixel=NULL;
int pixelColor (SDL_Surface *dst, Sint16 x, Sint16 y, Uint32 color)
{
SDL_Rect srect;
SDL_Rect drect;
int result;
/* Setup source rectangle for pixel */
srect.x=0;
srect.y=0;
srect.w=1;
srect.h=1;
/* Setup destination rectangle for pixel */
drect.x=x;
drect.y=y;
drect.w=1;
drect.h=1;
/* Create single pixel from destination surface format and add alpha
channel t
if (gfxPrimitivesSinglePixel==NULL) {
gfxPrimitivesSinglePixel=SDL_CreateRGBSurface(SDL_SWSURFACE |
SDL_HWSURFACE |
SDL_SetAlpha (gfxPrimitivesSinglePixel, SDL_SRCALPHA, 255);
}
/* Draw color into pixel*/
SDL_FillRect (gfxPrimitivesSinglePixel, &srect, color);
/* Draw pixel onto destination surface */
result=SDL_BlitSurface (gfxPrimitivesSinglePixel, &srect, dst, &drect);
return(result);
}
Mattias Engdeg?rd wrote:
This might be the error — my gcc didn’t zero-extend the len parameter
for the SDL_memset4 inline asm (generated a movw instead of a movzwl).
Try the following patch and see if it helps
Index: SDL_memops.h
RCS file: /cvs/SDL/src/video/Attic/SDL_memops.h,v
retrieving revision 1.1.2.15
diff -u -r1.1.2.15 SDL_memops.h
— SDL_memops.h 2001/02/18 09:07:58 1.1.2.15
+++ SDL_memops.h 2001/02/21 11:05:03
@@ -89,12 +89,12 @@
#define SDL_memset4(dst, val, len)
do { \
-
int u0, u1, u2; \
__asm__ __volatile__ ( \
"cld\n\t" \
"rep ; stosl\n\t" \
: "=&D" (u0), "=&a" (u1), "=&c" (u2) \
} while(0)
–
| Andreas Schiffler aschiffler at home.com |
| Senior Systems Engineer - Deskplayer Inc., Buffalo |
| 4707 Eastwood Cres., Niagara Falls, Ont L2E 1B4, Canada |
| +1-905-371-3652 (private) - +1-905-371-8834 (work/fax) |