Alpha blending code with mmx1 instructions

Hi

This is mmx1 alpha blending code for 555/565 -> 555/565, 888 -> 888
surface alpha blit and 8888->8888 pixel alpha blit. Additionaly has
support for RLE surface blits.
Sorry there is no support for mmx detections then if you don’t have
mmx, remove #define MMX_ALPHA_BLIT line from SDL_Blit.h file.

This code change one things, both pixel and surface alpha code save dst
alpha in resulting pixel. Till now only pixel alpha blit do it and
surface alpha blit set 0xFF alpha in resulting pixel. This fix some
problems with full ARGB buffers.

Rafal
-------------- next part --------------
A non-text attachment was scrubbed…
Name: mmx1_alpha_blend.diff
Type: text/x-patch
Size: 68565 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030507/cb16ed5d/attachment.bin

proc IsMMX
;identify existence of CPUID instruction … …
; identify Intel processor …
push ebx
mov EAX, 1 ; request for feature flags
CPUID ; 0Fh, 0A2h CPUID instruction
xor eax,eax
test EDX, 00800000h ; Is IA MMX technology bit (Bit 23 of EDX)
; in feature flags set?
jz .done
.MMX_Technology_Found:
inc eax
.done:
pop ebx
endp> ----- Original Message -----

From: bursig@poczta.fm (Rafal Bursig)
To: “sdl”
Sent: Wednesday, May 07, 2003 3:39 AM
Subject: [SDL] alpha blending code with mmx1 instructions

Hi

This is mmx1 alpha blending code for 555/565 -> 555/565, 888 -> 888
surface alpha blit and 8888->8888 pixel alpha blit. Additionaly has
support for RLE surface blits.
Sorry there is no support for mmx detections then if you don’t have
mmx, remove #define MMX_ALPHA_BLIT line from SDL_Blit.h file.

This code change one things, both pixel and surface alpha code save dst
alpha in resulting pixel. Till now only pixel alpha blit do it and
surface alpha blit set 0xFF alpha in resulting pixel. This fix some
problems with full ARGB buffers.

Rafal