comparison src/video/SDL_RLEaccel.c @ 739:22dbf364c017

Added SDL_HasMMX(), SDL_Has3DNow(), SDL_HasSSE() in SDL_cpuinfo.h
author Sam Lantinga <slouken@libsdl.org>
date Tue, 18 Nov 2003 01:27:06 +0000
parents 5bb080d35049
children b8d311d90021
comparison
equal deleted inserted replaced
738:82b85b731fe3 739:22dbf364c017
102 #include "SDL_memops.h" 102 #include "SDL_memops.h"
103 #include "SDL_RLEaccel_c.h" 103 #include "SDL_RLEaccel_c.h"
104 104
105 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT) 105 #if defined(i386) && defined(__GNUC__) && defined(USE_ASMBLIT)
106 #include "mmx.h" 106 #include "mmx.h"
107 /* Function to check the CPU flags */ 107 #include "SDL_cpuinfo.h"
108 #define MMX_CPU 0x800000
109 #define CPU_Flags() Hermes_X86_CPU()
110 #define X86_ASSEMBLER
111 #define HermesConverterInterface void
112 #define HermesClearInterface void
113 #define STACKCALL
114 #include "HeadX86.h"
115 #endif 108 #endif
116 109
117 #ifndef MAX 110 #ifndef MAX
118 #define MAX(a, b) ((a) > (b) ? (a) : (b)) 111 #define MAX(a, b) ((a) > (b) ? (a) : (b))
119 #endif 112 #endif
655 || fmt->Rmask == 0x07e0 \ 648 || fmt->Rmask == 0x07e0 \
656 || fmt->Bmask == 0x07e0) { \ 649 || fmt->Bmask == 0x07e0) { \
657 if(alpha == 128) \ 650 if(alpha == 128) \
658 blitter(2, Uint8, ALPHA_BLIT16_565_50); \ 651 blitter(2, Uint8, ALPHA_BLIT16_565_50); \
659 else { \ 652 else { \
660 if((CPU_Flags()&MMX_CPU)!=0) \ 653 if(SDL_HasMMX()) \
661 blitter(2, Uint8, ALPHA_BLIT16_565MMX); \ 654 blitter(2, Uint8, ALPHA_BLIT16_565MMX); \
662 else \ 655 else \
663 blitter(2, Uint8, ALPHA_BLIT16_565); \ 656 blitter(2, Uint8, ALPHA_BLIT16_565); \
664 } \ 657 } \
665 } else \ 658 } else \
671 || fmt->Rmask == 0x03e0 \ 664 || fmt->Rmask == 0x03e0 \
672 || fmt->Bmask == 0x03e0) { \ 665 || fmt->Bmask == 0x03e0) { \
673 if(alpha == 128) \ 666 if(alpha == 128) \
674 blitter(2, Uint8, ALPHA_BLIT16_555_50); \ 667 blitter(2, Uint8, ALPHA_BLIT16_555_50); \
675 else { \ 668 else { \
676 if((CPU_Flags()&MMX_CPU)!=0) \ 669 if(SDL_HasMMX()) \
677 blitter(2, Uint8, ALPHA_BLIT16_555MMX); \ 670 blitter(2, Uint8, ALPHA_BLIT16_555MMX); \
678 else \ 671 else \
679 blitter(2, Uint8, ALPHA_BLIT16_555); \ 672 blitter(2, Uint8, ALPHA_BLIT16_555); \
680 } \ 673 } \
681 break; \ 674 break; \
696 if((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \ 689 if((fmt->Rmask | fmt->Gmask | fmt->Bmask) == 0x00ffffff \
697 && (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \ 690 && (fmt->Gmask == 0xff00 || fmt->Rmask == 0xff00 \
698 || fmt->Bmask == 0xff00)) { \ 691 || fmt->Bmask == 0xff00)) { \
699 if(alpha == 128) \ 692 if(alpha == 128) \
700 { \ 693 { \
701 if((CPU_Flags()&MMX_CPU)!=0) \ 694 if(SDL_HasMMX()) \
702 blitter(4, Uint16, ALPHA_BLIT32_888_50MMX);\ 695 blitter(4, Uint16, ALPHA_BLIT32_888_50MMX);\
703 else \ 696 else \
704 blitter(4, Uint16, ALPHA_BLIT32_888_50);\ 697 blitter(4, Uint16, ALPHA_BLIT32_888_50);\
705 } \ 698 } \
706 else \ 699 else \
707 { \ 700 { \
708 if((CPU_Flags()&MMX_CPU)!=0) \ 701 if(SDL_HasMMX()) \
709 blitter(4, Uint16, ALPHA_BLIT32_888MMX);\ 702 blitter(4, Uint16, ALPHA_BLIT32_888MMX);\
710 else \ 703 else \
711 blitter(4, Uint16, ALPHA_BLIT32_888); \ 704 blitter(4, Uint16, ALPHA_BLIT32_888); \
712 } \ 705 } \
713 } else \ 706 } else \