src/video/SDL_blit_N.c
changeset 1895 c121d94672cb
parent 1795 398ac0f88e4d
child 1985 8055185ae4ed
     1.1 --- a/src/video/SDL_blit_N.c	Thu Jul 06 18:01:37 2006 +0000
     1.2 +++ b/src/video/SDL_blit_N.c	Mon Jul 10 21:04:37 2006 +0000
     1.3 @@ -38,20 +38,23 @@
     1.4  #define assert(X)
     1.5  #ifdef __MACOSX__
     1.6  #include <sys/sysctl.h>
     1.7 -static size_t GetL3CacheSize( void )
     1.8 +static size_t
     1.9 +GetL3CacheSize(void)
    1.10  {
    1.11      const char key[] = "hw.l3cachesize";
    1.12      u_int64_t result = 0;
    1.13 -    size_t typeSize = sizeof( result );
    1.14 +    size_t typeSize = sizeof(result);
    1.15  
    1.16  
    1.17 -    int err = sysctlbyname( key, &result, &typeSize, NULL, 0 );
    1.18 -    if( 0 != err ) return 0;
    1.19 +    int err = sysctlbyname(key, &result, &typeSize, NULL, 0);
    1.20 +    if (0 != err)
    1.21 +        return 0;
    1.22  
    1.23      return result;
    1.24  }
    1.25  #else
    1.26 -static size_t GetL3CacheSize( void )
    1.27 +static size_t
    1.28 +GetL3CacheSize(void)
    1.29  {
    1.30      /* XXX: Just guess G4 */
    1.31      return 2097152;
    1.32 @@ -59,14 +62,14 @@
    1.33  #endif /* __MACOSX__ */
    1.34  
    1.35  #if (defined(__MACOSX__) && (__GNUC__ < 4))
    1.36 -    #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
    1.37 +#define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
    1.38          (vector unsigned char) ( a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p )
    1.39 -    #define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
    1.40 +#define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
    1.41          (vector unsigned short) ( a,b,c,d,e,f,g,h )
    1.42  #else
    1.43 -    #define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
    1.44 +#define VECUINT8_LITERAL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
    1.45          (vector unsigned char) { a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p }
    1.46 -    #define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
    1.47 +#define VECUINT16_LITERAL(a,b,c,d,e,f,g,h) \
    1.48          (vector unsigned short) { a,b,c,d,e,f,g,h }
    1.49  #endif
    1.50  
    1.51 @@ -101,11 +104,11 @@
    1.52      : vec_add(vec_lvsl(8, src), vec_splat_u8(8)))
    1.53  
    1.54  /* Calculate the permute vector used for 32->32 swizzling */
    1.55 -static vector unsigned char calc_swizzle32(const SDL_PixelFormat *srcfmt,
    1.56 -                                  const SDL_PixelFormat *dstfmt)
    1.57 +static vector unsigned char
    1.58 +calc_swizzle32(const SDL_PixelFormat * srcfmt, const SDL_PixelFormat * dstfmt)
    1.59  {
    1.60      /*
    1.61 -    * We have to assume that the bits that aren't used by other
    1.62 +     * We have to assume that the bits that aren't used by other
    1.63       *  colors is alpha, and it's one complete byte, since some formats
    1.64       *  leave alpha with a zero mask, but we should still swizzle the bits.
    1.65       */
    1.66 @@ -115,18 +118,19 @@
    1.67          0, 0, 0, 0,
    1.68          16, 8, 0, 24,
    1.69          0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
    1.70 -        0, 0};
    1.71 +        0, 0
    1.72 +    };
    1.73      if (!srcfmt) {
    1.74          srcfmt = &default_pixel_format;
    1.75      }
    1.76      if (!dstfmt) {
    1.77          dstfmt = &default_pixel_format;
    1.78      }
    1.79 -    const vector unsigned char plus = VECUINT8_LITERAL(
    1.80 -                                      0x00, 0x00, 0x00, 0x00,
    1.81 -                                      0x04, 0x04, 0x04, 0x04,
    1.82 -                                      0x08, 0x08, 0x08, 0x08,
    1.83 -                                      0x0C, 0x0C, 0x0C, 0x0C );
    1.84 +    const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00,
    1.85 +                                                       0x04, 0x04, 0x04, 0x04,
    1.86 +                                                       0x08, 0x08, 0x08, 0x08,
    1.87 +                                                       0x0C, 0x0C, 0x0C,
    1.88 +                                                       0x0C);
    1.89      vector unsigned char vswiz;
    1.90      vector unsigned int srcvec;
    1.91  #define RESHIFT(X) (3 - ((X) >> 3))
    1.92 @@ -136,18 +140,24 @@
    1.93      Uint32 amask;
    1.94      /* Use zero for alpha if either surface doesn't have alpha */
    1.95      if (dstfmt->Amask) {
    1.96 -        amask = ((srcfmt->Amask) ? RESHIFT(srcfmt->Ashift) : 0x10) << (dstfmt->Ashift);
    1.97 -    } else {    
    1.98 -        amask = 0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^ 0xFFFFFFFF);
    1.99 -    }           
   1.100 -#undef RESHIFT  
   1.101 -    ((unsigned int *)(char*)&srcvec)[0] = (rmask | gmask | bmask | amask);
   1.102 -    vswiz = vec_add(plus, (vector unsigned char)vec_splat(srcvec, 0));
   1.103 -    return(vswiz);
   1.104 +        amask =
   1.105 +            ((srcfmt->Amask) ? RESHIFT(srcfmt->Ashift) : 0x10) << (dstfmt->
   1.106 +                                                                   Ashift);
   1.107 +    } else {
   1.108 +        amask =
   1.109 +            0x10101010 & ((dstfmt->Rmask | dstfmt->Gmask | dstfmt->Bmask) ^
   1.110 +                          0xFFFFFFFF);
   1.111 +    }
   1.112 +#undef RESHIFT
   1.113 +    ((unsigned int *) (char *) &srcvec)[0] = (rmask | gmask | bmask | amask);
   1.114 +    vswiz = vec_add(plus, (vector unsigned char) vec_splat(srcvec, 0));
   1.115 +    return (vswiz);
   1.116  }
   1.117  
   1.118 -static void Blit_RGB888_RGB565(SDL_BlitInfo *info);
   1.119 -static void Blit_RGB888_RGB565Altivec(SDL_BlitInfo *info) {
   1.120 +static void Blit_RGB888_RGB565(SDL_BlitInfo * info);
   1.121 +static void
   1.122 +Blit_RGB888_RGB565Altivec(SDL_BlitInfo * info)
   1.123 +{
   1.124      int height = info->d_height;
   1.125      Uint8 *src = (Uint8 *) info->s_pixels;
   1.126      int srcskip = info->s_skip;
   1.127 @@ -156,20 +166,19 @@
   1.128      SDL_PixelFormat *srcfmt = info->src;
   1.129      vector unsigned char valpha = vec_splat_u8(0);
   1.130      vector unsigned char vpermute = calc_swizzle32(srcfmt, NULL);
   1.131 -    vector unsigned char vgmerge = VECUINT8_LITERAL(
   1.132 -        0x00, 0x02, 0x00, 0x06,
   1.133 -        0x00, 0x0a, 0x00, 0x0e,
   1.134 -        0x00, 0x12, 0x00, 0x16,
   1.135 -        0x00, 0x1a, 0x00, 0x1e);
   1.136 +    vector unsigned char vgmerge = VECUINT8_LITERAL(0x00, 0x02, 0x00, 0x06,
   1.137 +                                                    0x00, 0x0a, 0x00, 0x0e,
   1.138 +                                                    0x00, 0x12, 0x00, 0x16,
   1.139 +                                                    0x00, 0x1a, 0x00, 0x1e);
   1.140      vector unsigned short v1 = vec_splat_u16(1);
   1.141      vector unsigned short v3 = vec_splat_u16(3);
   1.142 -    vector unsigned short v3f = VECUINT16_LITERAL(
   1.143 -        0x003f, 0x003f, 0x003f, 0x003f,
   1.144 -        0x003f, 0x003f, 0x003f, 0x003f);
   1.145 -    vector unsigned short vfc = VECUINT16_LITERAL(
   1.146 -        0x00fc, 0x00fc, 0x00fc, 0x00fc,
   1.147 -        0x00fc, 0x00fc, 0x00fc, 0x00fc);
   1.148 -    vector unsigned short vf800 = (vector unsigned short)vec_splat_u8(-7);
   1.149 +    vector unsigned short v3f =
   1.150 +        VECUINT16_LITERAL(0x003f, 0x003f, 0x003f, 0x003f,
   1.151 +                          0x003f, 0x003f, 0x003f, 0x003f);
   1.152 +    vector unsigned short vfc =
   1.153 +        VECUINT16_LITERAL(0x00fc, 0x00fc, 0x00fc, 0x00fc,
   1.154 +                          0x00fc, 0x00fc, 0x00fc, 0x00fc);
   1.155 +    vector unsigned short vf800 = (vector unsigned short) vec_splat_u8(-7);
   1.156      vf800 = vec_sl(vf800, vec_splat_u16(8));
   1.157  
   1.158      while (height--) {
   1.159 @@ -198,7 +207,7 @@
   1.160          ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width);
   1.161  
   1.162          /* After all that work, here's the vector part! */
   1.163 -        extrawidth = (width % 8);  /* trailing unaligned stores */
   1.164 +        extrawidth = (width % 8);       /* trailing unaligned stores */
   1.165          width -= extrawidth;
   1.166          vsrc = vec_ld(0, src);
   1.167          valigner = VEC_ALIGNER(src);
   1.168 @@ -210,23 +219,25 @@
   1.169  
   1.170              voverflow = vec_ld(15, src);
   1.171              vsrc = vec_perm(vsrc, voverflow, valigner);
   1.172 -            vsrc1 = (vector unsigned int)vec_perm(vsrc, valpha, vpermute);
   1.173 +            vsrc1 = (vector unsigned int) vec_perm(vsrc, valpha, vpermute);
   1.174              src += 16;
   1.175              vsrc = voverflow;
   1.176              voverflow = vec_ld(15, src);
   1.177              vsrc = vec_perm(vsrc, voverflow, valigner);
   1.178 -            vsrc2 = (vector unsigned int)vec_perm(vsrc, valpha, vpermute);
   1.179 +            vsrc2 = (vector unsigned int) vec_perm(vsrc, valpha, vpermute);
   1.180              /* 1555 */
   1.181 -            vpixel = (vector unsigned short)vec_packpx(vsrc1, vsrc2);
   1.182 -            vgpixel = (vector unsigned short)vec_perm(vsrc1, vsrc2, vgmerge);
   1.183 +            vpixel = (vector unsigned short) vec_packpx(vsrc1, vsrc2);
   1.184 +            vgpixel = (vector unsigned short) vec_perm(vsrc1, vsrc2, vgmerge);
   1.185              vgpixel = vec_and(vgpixel, vfc);
   1.186              vgpixel = vec_sl(vgpixel, v3);
   1.187              vrpixel = vec_sl(vpixel, v1);
   1.188              vrpixel = vec_and(vrpixel, vf800);
   1.189              vbpixel = vec_and(vpixel, v3f);
   1.190 -            vdst = vec_or((vector unsigned char)vrpixel, (vector unsigned char)vgpixel);
   1.191 +            vdst =
   1.192 +                vec_or((vector unsigned char) vrpixel,
   1.193 +                       (vector unsigned char) vgpixel);
   1.194              /* 565 */
   1.195 -            vdst = vec_or(vdst, (vector unsigned char)vbpixel);
   1.196 +            vdst = vec_or(vdst, (vector unsigned char) vbpixel);
   1.197              vec_st(vdst, 0, dst);
   1.198  
   1.199              width -= 8;
   1.200 @@ -241,14 +252,16 @@
   1.201          ONE_PIXEL_BLEND((extrawidth), extrawidth);
   1.202  #undef ONE_PIXEL_BLEND
   1.203  
   1.204 -        src += srcskip;  /* move to next row, accounting for pitch. */
   1.205 +        src += srcskip;         /* move to next row, accounting for pitch. */
   1.206          dst += dstskip;
   1.207      }
   1.208  
   1.209  
   1.210  }
   1.211  
   1.212 -static void Blit_RGB565_32Altivec(SDL_BlitInfo *info) {
   1.213 +static void
   1.214 +Blit_RGB565_32Altivec(SDL_BlitInfo * info)
   1.215 +{
   1.216      int height = info->d_height;
   1.217      Uint8 *src = (Uint8 *) info->s_pixels;
   1.218      int srcskip = info->s_skip;
   1.219 @@ -265,55 +278,52 @@
   1.220      vector unsigned short v2 = vec_splat_u16(2);
   1.221      vector unsigned short v3 = vec_splat_u16(3);
   1.222      /* 
   1.223 -        0x10 - 0x1f is the alpha
   1.224 -        0x00 - 0x0e evens are the red
   1.225 -        0x01 - 0x0f odds are zero
   1.226 -    */
   1.227 -    vector unsigned char vredalpha1 = VECUINT8_LITERAL(
   1.228 -        0x10, 0x00, 0x01, 0x01,
   1.229 -        0x10, 0x02, 0x01, 0x01,
   1.230 -        0x10, 0x04, 0x01, 0x01,
   1.231 -        0x10, 0x06, 0x01, 0x01
   1.232 -    );
   1.233 -    vector unsigned char vredalpha2 = (vector unsigned char) (
   1.234 -        vec_add((vector unsigned int)vredalpha1, vec_sl(v8, v16))
   1.235 -    );
   1.236 +       0x10 - 0x1f is the alpha
   1.237 +       0x00 - 0x0e evens are the red
   1.238 +       0x01 - 0x0f odds are zero
   1.239 +     */
   1.240 +    vector unsigned char vredalpha1 = VECUINT8_LITERAL(0x10, 0x00, 0x01, 0x01,
   1.241 +                                                       0x10, 0x02, 0x01, 0x01,
   1.242 +                                                       0x10, 0x04, 0x01, 0x01,
   1.243 +                                                       0x10, 0x06, 0x01,
   1.244 +                                                       0x01);
   1.245 +    vector unsigned char vredalpha2 =
   1.246 +        (vector unsigned
   1.247 +         char) (vec_add((vector unsigned int) vredalpha1, vec_sl(v8, v16))
   1.248 +        );
   1.249      /*
   1.250 -        0x00 - 0x0f is ARxx ARxx ARxx ARxx
   1.251 -        0x11 - 0x0f odds are blue
   1.252 -    */
   1.253 -    vector unsigned char vblue1 = VECUINT8_LITERAL(
   1.254 -        0x00, 0x01, 0x02, 0x11,
   1.255 -        0x04, 0x05, 0x06, 0x13,
   1.256 -        0x08, 0x09, 0x0a, 0x15,
   1.257 -        0x0c, 0x0d, 0x0e, 0x17
   1.258 -    );
   1.259 -    vector unsigned char vblue2 = (vector unsigned char)(
   1.260 -        vec_add((vector unsigned int)vblue1, v8)
   1.261 -    );
   1.262 +       0x00 - 0x0f is ARxx ARxx ARxx ARxx
   1.263 +       0x11 - 0x0f odds are blue
   1.264 +     */
   1.265 +    vector unsigned char vblue1 = VECUINT8_LITERAL(0x00, 0x01, 0x02, 0x11,
   1.266 +                                                   0x04, 0x05, 0x06, 0x13,
   1.267 +                                                   0x08, 0x09, 0x0a, 0x15,
   1.268 +                                                   0x0c, 0x0d, 0x0e, 0x17);
   1.269 +    vector unsigned char vblue2 =
   1.270 +        (vector unsigned char) (vec_add((vector unsigned int) vblue1, v8)
   1.271 +        );
   1.272      /*
   1.273 -        0x00 - 0x0f is ARxB ARxB ARxB ARxB
   1.274 -        0x10 - 0x0e evens are green
   1.275 -    */
   1.276 -    vector unsigned char vgreen1 = VECUINT8_LITERAL(
   1.277 -        0x00, 0x01, 0x10, 0x03,
   1.278 -        0x04, 0x05, 0x12, 0x07,
   1.279 -        0x08, 0x09, 0x14, 0x0b,
   1.280 -        0x0c, 0x0d, 0x16, 0x0f
   1.281 -    );
   1.282 -    vector unsigned char vgreen2 = (vector unsigned char)(
   1.283 -        vec_add((vector unsigned int)vgreen1, vec_sl(v8, v8))
   1.284 -    );
   1.285 -    
   1.286 +       0x00 - 0x0f is ARxB ARxB ARxB ARxB
   1.287 +       0x10 - 0x0e evens are green
   1.288 +     */
   1.289 +    vector unsigned char vgreen1 = VECUINT8_LITERAL(0x00, 0x01, 0x10, 0x03,
   1.290 +                                                    0x04, 0x05, 0x12, 0x07,
   1.291 +                                                    0x08, 0x09, 0x14, 0x0b,
   1.292 +                                                    0x0c, 0x0d, 0x16, 0x0f);
   1.293 +    vector unsigned char vgreen2 =
   1.294 +        (vector unsigned
   1.295 +         char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8))
   1.296 +        );
   1.297 +
   1.298  
   1.299      assert(srcfmt->BytesPerPixel == 2);
   1.300      assert(dstfmt->BytesPerPixel == 4);
   1.301  
   1.302 -    vf800 = (vector unsigned short)vec_splat_u8(-7);
   1.303 +    vf800 = (vector unsigned short) vec_splat_u8(-7);
   1.304      vf800 = vec_sl(vf800, vec_splat_u16(8));
   1.305  
   1.306      if (dstfmt->Amask && srcfmt->alpha) {
   1.307 -        ((unsigned char *)&valpha)[0] = alpha = srcfmt->alpha;
   1.308 +        ((unsigned char *) &valpha)[0] = alpha = srcfmt->alpha;
   1.309          valpha = vec_splat(valpha, 0);
   1.310      } else {
   1.311          alpha = 0;
   1.312 @@ -345,7 +355,7 @@
   1.313          ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width);
   1.314  
   1.315          /* After all that work, here's the vector part! */
   1.316 -        extrawidth = (width % 8);  /* trailing unaligned stores */
   1.317 +        extrawidth = (width % 8);       /* trailing unaligned stores */
   1.318          width -= extrawidth;
   1.319          vsrc = vec_ld(0, src);
   1.320          valigner = VEC_ALIGNER(src);
   1.321 @@ -357,22 +367,26 @@
   1.322              voverflow = vec_ld(15, src);
   1.323              vsrc = vec_perm(vsrc, voverflow, valigner);
   1.324  
   1.325 -            vR = vec_and((vector unsigned short)vsrc, vf800);
   1.326 -            vB = vec_sl((vector unsigned short)vsrc, v3);
   1.327 +            vR = vec_and((vector unsigned short) vsrc, vf800);
   1.328 +            vB = vec_sl((vector unsigned short) vsrc, v3);
   1.329              vG = vec_sl(vB, v2);
   1.330  
   1.331 -            vdst1 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha1);
   1.332 -            vdst1 = vec_perm(vdst1, (vector unsigned char)vB, vblue1);
   1.333 -            vdst1 = vec_perm(vdst1, (vector unsigned char)vG, vgreen1);
   1.334 +            vdst1 =
   1.335 +                (vector unsigned char) vec_perm((vector unsigned char) vR,
   1.336 +                                                valpha, vredalpha1);
   1.337 +            vdst1 = vec_perm(vdst1, (vector unsigned char) vB, vblue1);
   1.338 +            vdst1 = vec_perm(vdst1, (vector unsigned char) vG, vgreen1);
   1.339              vdst1 = vec_perm(vdst1, valpha, vpermute);
   1.340              vec_st(vdst1, 0, dst);
   1.341  
   1.342 -            vdst2 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha2);
   1.343 -            vdst2 = vec_perm(vdst2, (vector unsigned char)vB, vblue2);
   1.344 -            vdst2 = vec_perm(vdst2, (vector unsigned char)vG, vgreen2);
   1.345 +            vdst2 =
   1.346 +                (vector unsigned char) vec_perm((vector unsigned char) vR,
   1.347 +                                                valpha, vredalpha2);
   1.348 +            vdst2 = vec_perm(vdst2, (vector unsigned char) vB, vblue2);
   1.349 +            vdst2 = vec_perm(vdst2, (vector unsigned char) vG, vgreen2);
   1.350              vdst2 = vec_perm(vdst2, valpha, vpermute);
   1.351              vec_st(vdst2, 16, dst);
   1.352 -            
   1.353 +
   1.354              width -= 8;
   1.355              dst += 32;
   1.356              src += 16;
   1.357 @@ -386,14 +400,16 @@
   1.358          ONE_PIXEL_BLEND((extrawidth), extrawidth);
   1.359  #undef ONE_PIXEL_BLEND
   1.360  
   1.361 -        src += srcskip;  /* move to next row, accounting for pitch. */
   1.362 +        src += srcskip;         /* move to next row, accounting for pitch. */
   1.363          dst += dstskip;
   1.364      }
   1.365  
   1.366  }
   1.367  
   1.368  
   1.369 -static void Blit_RGB555_32Altivec(SDL_BlitInfo *info) {
   1.370 +static void
   1.371 +Blit_RGB555_32Altivec(SDL_BlitInfo * info)
   1.372 +{
   1.373      int height = info->d_height;
   1.374      Uint8 *src = (Uint8 *) info->s_pixels;
   1.375      int srcskip = info->s_skip;
   1.376 @@ -410,55 +426,52 @@
   1.377      vector unsigned short v1 = vec_splat_u16(1);
   1.378      vector unsigned short v3 = vec_splat_u16(3);
   1.379      /* 
   1.380 -        0x10 - 0x1f is the alpha
   1.381 -        0x00 - 0x0e evens are the red
   1.382 -        0x01 - 0x0f odds are zero
   1.383 -    */
   1.384 -    vector unsigned char vredalpha1 = VECUINT8_LITERAL(
   1.385 -        0x10, 0x00, 0x01, 0x01,
   1.386 -        0x10, 0x02, 0x01, 0x01,
   1.387 -        0x10, 0x04, 0x01, 0x01,
   1.388 -        0x10, 0x06, 0x01, 0x01
   1.389 -    );
   1.390 -    vector unsigned char vredalpha2 = (vector unsigned char)(
   1.391 -        vec_add((vector unsigned int)vredalpha1, vec_sl(v8, v16))
   1.392 -    );
   1.393 +       0x10 - 0x1f is the alpha
   1.394 +       0x00 - 0x0e evens are the red
   1.395 +       0x01 - 0x0f odds are zero
   1.396 +     */
   1.397 +    vector unsigned char vredalpha1 = VECUINT8_LITERAL(0x10, 0x00, 0x01, 0x01,
   1.398 +                                                       0x10, 0x02, 0x01, 0x01,
   1.399 +                                                       0x10, 0x04, 0x01, 0x01,
   1.400 +                                                       0x10, 0x06, 0x01,
   1.401 +                                                       0x01);
   1.402 +    vector unsigned char vredalpha2 =
   1.403 +        (vector unsigned
   1.404 +         char) (vec_add((vector unsigned int) vredalpha1, vec_sl(v8, v16))
   1.405 +        );
   1.406      /*
   1.407 -        0x00 - 0x0f is ARxx ARxx ARxx ARxx
   1.408 -        0x11 - 0x0f odds are blue
   1.409 -    */
   1.410 -    vector unsigned char vblue1 = VECUINT8_LITERAL(
   1.411 -        0x00, 0x01, 0x02, 0x11,
   1.412 -        0x04, 0x05, 0x06, 0x13,
   1.413 -        0x08, 0x09, 0x0a, 0x15,
   1.414 -        0x0c, 0x0d, 0x0e, 0x17
   1.415 -    );
   1.416 -    vector unsigned char vblue2 = (vector unsigned char)(
   1.417 -        vec_add((vector unsigned int)vblue1, v8)
   1.418 -    );
   1.419 +       0x00 - 0x0f is ARxx ARxx ARxx ARxx
   1.420 +       0x11 - 0x0f odds are blue
   1.421 +     */
   1.422 +    vector unsigned char vblue1 = VECUINT8_LITERAL(0x00, 0x01, 0x02, 0x11,
   1.423 +                                                   0x04, 0x05, 0x06, 0x13,
   1.424 +                                                   0x08, 0x09, 0x0a, 0x15,
   1.425 +                                                   0x0c, 0x0d, 0x0e, 0x17);
   1.426 +    vector unsigned char vblue2 =
   1.427 +        (vector unsigned char) (vec_add((vector unsigned int) vblue1, v8)
   1.428 +        );
   1.429      /*
   1.430 -        0x00 - 0x0f is ARxB ARxB ARxB ARxB
   1.431 -        0x10 - 0x0e evens are green
   1.432 -    */
   1.433 -    vector unsigned char vgreen1 = VECUINT8_LITERAL(
   1.434 -        0x00, 0x01, 0x10, 0x03,
   1.435 -        0x04, 0x05, 0x12, 0x07,
   1.436 -        0x08, 0x09, 0x14, 0x0b,
   1.437 -        0x0c, 0x0d, 0x16, 0x0f
   1.438 -    );
   1.439 -    vector unsigned char vgreen2 = (vector unsigned char)(
   1.440 -        vec_add((vector unsigned int)vgreen1, vec_sl(v8, v8))
   1.441 -    );
   1.442 -    
   1.443 +       0x00 - 0x0f is ARxB ARxB ARxB ARxB
   1.444 +       0x10 - 0x0e evens are green
   1.445 +     */
   1.446 +    vector unsigned char vgreen1 = VECUINT8_LITERAL(0x00, 0x01, 0x10, 0x03,
   1.447 +                                                    0x04, 0x05, 0x12, 0x07,
   1.448 +                                                    0x08, 0x09, 0x14, 0x0b,
   1.449 +                                                    0x0c, 0x0d, 0x16, 0x0f);
   1.450 +    vector unsigned char vgreen2 =
   1.451 +        (vector unsigned
   1.452 +         char) (vec_add((vector unsigned int) vgreen1, vec_sl(v8, v8))
   1.453 +        );
   1.454 +
   1.455  
   1.456      assert(srcfmt->BytesPerPixel == 2);
   1.457      assert(dstfmt->BytesPerPixel == 4);
   1.458  
   1.459 -    vf800 = (vector unsigned short)vec_splat_u8(-7);
   1.460 +    vf800 = (vector unsigned short) vec_splat_u8(-7);
   1.461      vf800 = vec_sl(vf800, vec_splat_u16(8));
   1.462  
   1.463      if (dstfmt->Amask && srcfmt->alpha) {
   1.464 -        ((unsigned char *)&valpha)[0] = alpha = srcfmt->alpha;
   1.465 +        ((unsigned char *) &valpha)[0] = alpha = srcfmt->alpha;
   1.466          valpha = vec_splat(valpha, 0);
   1.467      } else {
   1.468          alpha = 0;
   1.469 @@ -490,7 +503,7 @@
   1.470          ONE_PIXEL_BLEND(((UNALIGNED_PTR(dst)) && (width)), width);
   1.471  
   1.472          /* After all that work, here's the vector part! */
   1.473 -        extrawidth = (width % 8);  /* trailing unaligned stores */
   1.474 +        extrawidth = (width % 8);       /* trailing unaligned stores */
   1.475          width -= extrawidth;
   1.476          vsrc = vec_ld(0, src);
   1.477          valigner = VEC_ALIGNER(src);
   1.478 @@ -502,22 +515,26 @@
   1.479              voverflow = vec_ld(15, src);
   1.480              vsrc = vec_perm(vsrc, voverflow, valigner);
   1.481  
   1.482 -            vR = vec_and(vec_sl((vector unsigned short)vsrc,v1), vf800);
   1.483 -            vB = vec_sl((vector unsigned short)vsrc, v3);
   1.484 +            vR = vec_and(vec_sl((vector unsigned short) vsrc, v1), vf800);
   1.485 +            vB = vec_sl((vector unsigned short) vsrc, v3);
   1.486              vG = vec_sl(vB, v3);
   1.487  
   1.488 -            vdst1 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha1);
   1.489 -            vdst1 = vec_perm(vdst1, (vector unsigned char)vB, vblue1);
   1.490 -            vdst1 = vec_perm(vdst1, (vector unsigned char)vG, vgreen1);
   1.491 +            vdst1 =
   1.492 +                (vector unsigned char) vec_perm((vector unsigned char) vR,
   1.493 +                                                valpha, vredalpha1);
   1.494 +            vdst1 = vec_perm(vdst1, (vector unsigned char) vB, vblue1);
   1.495 +            vdst1 = vec_perm(vdst1, (vector unsigned char) vG, vgreen1);
   1.496              vdst1 = vec_perm(vdst1, valpha, vpermute);
   1.497              vec_st(vdst1, 0, dst);
   1.498  
   1.499 -            vdst2 = (vector unsigned char)vec_perm((vector unsigned char)vR, valpha, vredalpha2);
   1.500 -            vdst2 = vec_perm(vdst2, (vector unsigned char)vB, vblue2);
   1.501 -            vdst2 = vec_perm(vdst2, (vector unsigned char)vG, vgreen2);
   1.502 +            vdst2 =
   1.503 +                (vector unsigned char) vec_perm((vector unsigned char) vR,
   1.504 +                                                valpha, vredalpha2);
   1.505 +            vdst2 = vec_perm(vdst2, (vector unsigned char) vB, vblue2);
   1.506 +            vdst2 = vec_perm(vdst2, (vector unsigned char) vG, vgreen2);
   1.507              vdst2 = vec_perm(vdst2, valpha, vpermute);
   1.508              vec_st(vdst2, 16, dst);
   1.509 -            
   1.510 +
   1.511              width -= 8;
   1.512              dst += 32;
   1.513              src += 16;
   1.514 @@ -531,15 +548,16 @@
   1.515          ONE_PIXEL_BLEND((extrawidth), extrawidth);
   1.516  #undef ONE_PIXEL_BLEND
   1.517  
   1.518 -        src += srcskip;  /* move to next row, accounting for pitch. */
   1.519 +        src += srcskip;         /* move to next row, accounting for pitch. */
   1.520          dst += dstskip;
   1.521      }
   1.522  
   1.523  }
   1.524  
   1.525 -static void BlitNtoNKey(SDL_BlitInfo *info);
   1.526 -static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info);
   1.527 -static void Blit32to32KeyAltivec(SDL_BlitInfo *info)
   1.528 +static void BlitNtoNKey(SDL_BlitInfo * info);
   1.529 +static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info);
   1.530 +static void
   1.531 +Blit32to32KeyAltivec(SDL_BlitInfo * info)
   1.532  {
   1.533      int height = info->d_height;
   1.534      Uint32 *srcp = (Uint32 *) info->s_pixels;
   1.535 @@ -551,9 +569,9 @@
   1.536      SDL_PixelFormat *dstfmt = info->dst;
   1.537      int dstbpp = dstfmt->BytesPerPixel;
   1.538      int copy_alpha = (srcfmt->Amask && dstfmt->Amask);
   1.539 -	unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
   1.540 +    unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
   1.541      Uint32 rgbmask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
   1.542 -	Uint32 ckey = info->src->colorkey;
   1.543 +    Uint32 ckey = info->src->colorkey;
   1.544      vector unsigned int valpha;
   1.545      vector unsigned char vpermute;
   1.546      vector unsigned char vzero;
   1.547 @@ -561,7 +579,7 @@
   1.548      vector unsigned int vrgbmask;
   1.549      vpermute = calc_swizzle32(srcfmt, dstfmt);
   1.550      if (info->d_width < 16) {
   1.551 -        if(copy_alpha) {
   1.552 +        if (copy_alpha) {
   1.553              BlitNtoNKeyCopyAlpha(info);
   1.554          } else {
   1.555              BlitNtoNKey(info);
   1.556 @@ -570,15 +588,16 @@
   1.557      }
   1.558      vzero = vec_splat_u8(0);
   1.559      if (alpha) {
   1.560 -        ((unsigned char *)&valpha)[0] = (unsigned char)alpha;
   1.561 -        valpha = (vector unsigned int)vec_splat((vector unsigned char)valpha, 0);
   1.562 +        ((unsigned char *) &valpha)[0] = (unsigned char) alpha;
   1.563 +        valpha =
   1.564 +            (vector unsigned int) vec_splat((vector unsigned char) valpha, 0);
   1.565      } else {
   1.566 -        valpha = (vector unsigned int)vzero;
   1.567 +        valpha = (vector unsigned int) vzero;
   1.568      }
   1.569      ckey &= rgbmask;
   1.570 -    ((unsigned int *)(char*)&vckey)[0] = ckey;
   1.571 +    ((unsigned int *) (char *) &vckey)[0] = ckey;
   1.572      vckey = vec_splat(vckey, 0);
   1.573 -    ((unsigned int *)(char*)&vrgbmask)[0] = rgbmask;
   1.574 +    ((unsigned int *) (char *) &vrgbmask)[0] = rgbmask;
   1.575      vrgbmask = vec_splat(vrgbmask, 0);
   1.576  
   1.577      while (height--) {
   1.578 @@ -628,15 +647,17 @@
   1.579                  /* load the source vec */
   1.580                  vs = vec_perm(vs, voverflow, valigner);
   1.581                  /* vsel is set for items that match the key */
   1.582 -                vsel = (vector unsigned char)vec_and(vs, vrgbmask);
   1.583 -                vsel = (vector unsigned char)vec_cmpeq(vs, vckey);
   1.584 +                vsel = (vector unsigned char) vec_and(vs, vrgbmask);
   1.585 +                vsel = (vector unsigned char) vec_cmpeq(vs, vckey);
   1.586                  /* permute the src vec to the dest format */
   1.587                  vs = vec_perm(vs, valpha, vpermute);
   1.588                  /* load the destination vec */
   1.589                  vd = vec_ld(0, dstp);
   1.590                  /* select the source and dest into vs */
   1.591 -                vd = (vector unsigned int)vec_sel((vector unsigned char)vs, (vector unsigned char)vd, vsel);
   1.592 -                
   1.593 +                vd = (vector unsigned int) vec_sel((vector unsigned char) vs,
   1.594 +                                                   (vector unsigned char) vd,
   1.595 +                                                   vsel);
   1.596 +
   1.597                  vec_st(vd, 0, dstp);
   1.598                  srcp += 4;
   1.599                  width -= 4;
   1.600 @@ -653,7 +674,8 @@
   1.601  
   1.602  /* Altivec code to swizzle one 32-bit surface to a different 32-bit format. */
   1.603  /* Use this on a G5 */
   1.604 -static void ConvertAltivec32to32_noprefetch(SDL_BlitInfo *info)
   1.605 +static void
   1.606 +ConvertAltivec32to32_noprefetch(SDL_BlitInfo * info)
   1.607  {
   1.608      int height = info->d_height;
   1.609      Uint32 *src = (Uint32 *) info->s_pixels;
   1.610 @@ -667,8 +689,8 @@
   1.611      if (dstfmt->Amask && !srcfmt->Amask) {
   1.612          if (srcfmt->alpha) {
   1.613              vector unsigned char valpha;
   1.614 -            ((unsigned char *)&valpha)[0] = srcfmt->alpha;
   1.615 -            vzero = (vector unsigned int)vec_splat(valpha, 0);
   1.616 +            ((unsigned char *) &valpha)[0] = srcfmt->alpha;
   1.617 +            vzero = (vector unsigned int) vec_splat(valpha, 0);
   1.618          }
   1.619      }
   1.620  
   1.621 @@ -699,13 +721,13 @@
   1.622          valigner = VEC_ALIGNER(src);
   1.623          vbits = vec_ld(0, src);
   1.624  
   1.625 -       while (width) {
   1.626 +        while (width) {
   1.627              voverflow = vec_ld(15, src);
   1.628              src += 4;
   1.629              width -= 4;
   1.630 -            vbits = vec_perm(vbits, voverflow, valigner);  /* src is ready. */
   1.631 -            vbits = vec_perm(vbits, vzero, vpermute);  /* swizzle it. */
   1.632 -            vec_st(vbits, 0, dst);  /* store it back out. */
   1.633 +            vbits = vec_perm(vbits, voverflow, valigner);       /* src is ready. */
   1.634 +            vbits = vec_perm(vbits, vzero, vpermute);   /* swizzle it. */
   1.635 +            vec_st(vbits, 0, dst);      /* store it back out. */
   1.636              dst += 4;
   1.637              vbits = voverflow;
   1.638          }
   1.639 @@ -714,13 +736,13 @@
   1.640  
   1.641          /* cover pixels at the end of the row that didn't fit in 16 bytes. */
   1.642          while (extrawidth) {
   1.643 -            bits = *(src++);  /* max 7 pixels, don't bother with prefetch. */
   1.644 +            bits = *(src++);    /* max 7 pixels, don't bother with prefetch. */
   1.645              RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
   1.646              *(dst++) = MAKE8888(dstfmt, r, g, b, a);
   1.647              extrawidth--;
   1.648          }
   1.649  
   1.650 -        src += srcskip >> 2;  /* move to next row, accounting for pitch. */
   1.651 +        src += srcskip >> 2;    /* move to next row, accounting for pitch. */
   1.652          dst += dstskip >> 2;
   1.653      }
   1.654  
   1.655 @@ -728,10 +750,11 @@
   1.656  
   1.657  /* Altivec code to swizzle one 32-bit surface to a different 32-bit format. */
   1.658  /* Use this on a G4 */
   1.659 -static void ConvertAltivec32to32_prefetch(SDL_BlitInfo *info)
   1.660 +static void
   1.661 +ConvertAltivec32to32_prefetch(SDL_BlitInfo * info)
   1.662  {
   1.663 -    const int scalar_dst_lead = sizeof (Uint32) * 4;
   1.664 -    const int vector_dst_lead = sizeof (Uint32) * 16;
   1.665 +    const int scalar_dst_lead = sizeof(Uint32) * 4;
   1.666 +    const int vector_dst_lead = sizeof(Uint32) * 16;
   1.667  
   1.668      int height = info->d_height;
   1.669      Uint32 *src = (Uint32 *) info->s_pixels;
   1.670 @@ -745,8 +768,8 @@
   1.671      if (dstfmt->Amask && !srcfmt->Amask) {
   1.672          if (srcfmt->alpha) {
   1.673              vector unsigned char valpha;
   1.674 -            ((unsigned char *)&valpha)[0] = srcfmt->alpha;
   1.675 -            vzero = (vector unsigned int)vec_splat(valpha, 0);
   1.676 +            ((unsigned char *) &valpha)[0] = srcfmt->alpha;
   1.677 +            vzero = (vector unsigned int) vec_splat(valpha, 0);
   1.678          }
   1.679      }
   1.680  
   1.681 @@ -765,8 +788,10 @@
   1.682  
   1.683          /* do scalar until we can align... */
   1.684          while ((UNALIGNED_PTR(dst)) && (width)) {
   1.685 -            vec_dstt(src+scalar_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_SRC);
   1.686 -            vec_dstst(dst+scalar_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_DEST);
   1.687 +            vec_dstt(src + scalar_dst_lead, DST_CTRL(2, 32, 1024),
   1.688 +                     DST_CHAN_SRC);
   1.689 +            vec_dstst(dst + scalar_dst_lead, DST_CTRL(2, 32, 1024),
   1.690 +                      DST_CHAN_DEST);
   1.691              bits = *(src++);
   1.692              RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
   1.693              *(dst++) = MAKE8888(dstfmt, r, g, b, a);
   1.694 @@ -780,29 +805,31 @@
   1.695          vbits = vec_ld(0, src);
   1.696  
   1.697          while (width) {
   1.698 -            vec_dstt(src+vector_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_SRC);
   1.699 -            vec_dstst(dst+vector_dst_lead, DST_CTRL(2,32,1024), DST_CHAN_DEST);
   1.700 +            vec_dstt(src + vector_dst_lead, DST_CTRL(2, 32, 1024),
   1.701 +                     DST_CHAN_SRC);
   1.702 +            vec_dstst(dst + vector_dst_lead, DST_CTRL(2, 32, 1024),
   1.703 +                      DST_CHAN_DEST);
   1.704              voverflow = vec_ld(15, src);
   1.705              src += 4;
   1.706              width -= 4;
   1.707 -            vbits = vec_perm(vbits, voverflow, valigner);  /* src is ready. */
   1.708 -            vbits = vec_perm(vbits, vzero, vpermute);  /* swizzle it. */
   1.709 -            vec_st(vbits, 0, dst);  /* store it back out. */
   1.710 +            vbits = vec_perm(vbits, voverflow, valigner);       /* src is ready. */
   1.711 +            vbits = vec_perm(vbits, vzero, vpermute);   /* swizzle it. */
   1.712 +            vec_st(vbits, 0, dst);      /* store it back out. */
   1.713              dst += 4;
   1.714              vbits = voverflow;
   1.715          }
   1.716 -        
   1.717 +
   1.718          assert(width == 0);
   1.719  
   1.720          /* cover pixels at the end of the row that didn't fit in 16 bytes. */
   1.721          while (extrawidth) {
   1.722 -            bits = *(src++);  /* max 7 pixels, don't bother with prefetch. */
   1.723 +            bits = *(src++);    /* max 7 pixels, don't bother with prefetch. */
   1.724              RGBA_FROM_8888(bits, srcfmt, r, g, b, a);
   1.725              *(dst++) = MAKE8888(dstfmt, r, g, b, a);
   1.726              extrawidth--;
   1.727          }
   1.728  
   1.729 -        src += srcskip >> 2;  /* move to next row, accounting for pitch. */
   1.730 +        src += srcskip >> 2;    /* move to next row, accounting for pitch. */
   1.731          dst += dstskip >> 2;
   1.732      }
   1.733  
   1.734 @@ -810,7 +837,8 @@
   1.735      vec_dss(DST_CHAN_DEST);
   1.736  }
   1.737  
   1.738 -static Uint32 GetBlitFeatures( void )
   1.739 +static Uint32
   1.740 +GetBlitFeatures(void)
   1.741  {
   1.742      static Uint32 features = 0xffffffff;
   1.743      if (features == 0xffffffff) {
   1.744 @@ -820,19 +848,20 @@
   1.745              features = 0;
   1.746              SDL_sscanf(override, "%u", &features);
   1.747          } else {
   1.748 -            features = ( 0
   1.749 -                /* Feature 1 is has-MMX */
   1.750 -                | ((SDL_HasMMX()) ? 1 : 0)
   1.751 -                /* Feature 2 is has-AltiVec */
   1.752 -                | ((SDL_HasAltiVec()) ? 2 : 0)
   1.753 -                /* Feature 4 is dont-use-prefetch */
   1.754 -                /* !!!! FIXME: Check for G5 or later, not the cache size! Always prefetch on a G4. */
   1.755 -                | ((GetL3CacheSize() == 0) ? 4 : 0)
   1.756 -            );
   1.757 +            features = (0
   1.758 +                        /* Feature 1 is has-MMX */
   1.759 +                        | ((SDL_HasMMX())? 1 : 0)
   1.760 +                        /* Feature 2 is has-AltiVec */
   1.761 +                        | ((SDL_HasAltiVec())? 2 : 0)
   1.762 +                        /* Feature 4 is dont-use-prefetch */
   1.763 +                        /* !!!! FIXME: Check for G5 or later, not the cache size! Always prefetch on a G4. */
   1.764 +                        | ((GetL3CacheSize() == 0) ? 4 : 0)
   1.765 +                );
   1.766          }
   1.767      }
   1.768      return features;
   1.769  }
   1.770 +
   1.771  #if __MWERKS__
   1.772  #pragma altivec_model off
   1.773  #endif
   1.774 @@ -869,104 +898,110 @@
   1.775  	              (((src)&0x0000E000)>>11)| \
   1.776  	              (((src)&0x000000C0)>>6)); \
   1.777  }
   1.778 -static void Blit_RGB888_index8(SDL_BlitInfo *info)
   1.779 +static void
   1.780 +Blit_RGB888_index8(SDL_BlitInfo * info)
   1.781  {
   1.782  #ifndef USE_DUFFS_LOOP
   1.783 -	int c;
   1.784 +    int c;
   1.785  #endif
   1.786 -	int width, height;
   1.787 -	Uint32 *src;
   1.788 -	const Uint8 *map;
   1.789 -	Uint8 *dst;
   1.790 -	int srcskip, dstskip;
   1.791 +    int width, height;
   1.792 +    Uint32 *src;
   1.793 +    const Uint8 *map;
   1.794 +    Uint8 *dst;
   1.795 +    int srcskip, dstskip;
   1.796  
   1.797 -	/* Set up some basic variables */
   1.798 -	width = info->d_width;
   1.799 -	height = info->d_height;
   1.800 -	src = (Uint32 *)info->s_pixels;
   1.801 -	srcskip = info->s_skip/4;
   1.802 -	dst = info->d_pixels;
   1.803 -	dstskip = info->d_skip;
   1.804 -	map = info->table;
   1.805 +    /* Set up some basic variables */
   1.806 +    width = info->d_width;
   1.807 +    height = info->d_height;
   1.808 +    src = (Uint32 *) info->s_pixels;
   1.809 +    srcskip = info->s_skip / 4;
   1.810 +    dst = info->d_pixels;
   1.811 +    dstskip = info->d_skip;
   1.812 +    map = info->table;
   1.813  
   1.814 -	if ( map == NULL ) {
   1.815 -		while ( height-- ) {
   1.816 +    if (map == NULL) {
   1.817 +        while (height--) {
   1.818  #ifdef USE_DUFFS_LOOP
   1.819 +			/* *INDENT-OFF* */
   1.820  			DUFFS_LOOP(
   1.821  				RGB888_RGB332(*dst++, *src);
   1.822  			, width);
   1.823 +			/* *INDENT-ON* */
   1.824  #else
   1.825 -			for ( c=width/4; c; --c ) {
   1.826 -				/* Pack RGB into 8bit pixel */
   1.827 -				++src;
   1.828 -				RGB888_RGB332(*dst++, *src);
   1.829 -				++src;
   1.830 -				RGB888_RGB332(*dst++, *src);
   1.831 -				++src;
   1.832 -				RGB888_RGB332(*dst++, *src);
   1.833 -				++src;
   1.834 -			}
   1.835 -			switch ( width & 3 ) {
   1.836 -				case 3:
   1.837 -					RGB888_RGB332(*dst++, *src);
   1.838 -					++src;
   1.839 -				case 2:
   1.840 -					RGB888_RGB332(*dst++, *src);
   1.841 -					++src;
   1.842 -				case 1:
   1.843 -					RGB888_RGB332(*dst++, *src);
   1.844 -					++src;
   1.845 -			}
   1.846 +            for (c = width / 4; c; --c) {
   1.847 +                /* Pack RGB into 8bit pixel */
   1.848 +                ++src;
   1.849 +                RGB888_RGB332(*dst++, *src);
   1.850 +                ++src;
   1.851 +                RGB888_RGB332(*dst++, *src);
   1.852 +                ++src;
   1.853 +                RGB888_RGB332(*dst++, *src);
   1.854 +                ++src;
   1.855 +            }
   1.856 +            switch (width & 3) {
   1.857 +            case 3:
   1.858 +                RGB888_RGB332(*dst++, *src);
   1.859 +                ++src;
   1.860 +            case 2:
   1.861 +                RGB888_RGB332(*dst++, *src);
   1.862 +                ++src;
   1.863 +            case 1:
   1.864 +                RGB888_RGB332(*dst++, *src);
   1.865 +                ++src;
   1.866 +            }
   1.867  #endif /* USE_DUFFS_LOOP */
   1.868 -			src += srcskip;
   1.869 -			dst += dstskip;
   1.870 -		}
   1.871 -	} else {
   1.872 -		int Pixel;
   1.873 +            src += srcskip;
   1.874 +            dst += dstskip;
   1.875 +        }
   1.876 +    } else {
   1.877 +        int Pixel;
   1.878  
   1.879 -		while ( height-- ) {
   1.880 +        while (height--) {
   1.881  #ifdef USE_DUFFS_LOOP
   1.882 +			/* *INDENT-OFF* */
   1.883  			DUFFS_LOOP(
   1.884  				RGB888_RGB332(Pixel, *src);
   1.885  				*dst++ = map[Pixel];
   1.886  				++src;
   1.887  			, width);
   1.888 +			/* *INDENT-ON* */
   1.889  #else
   1.890 -			for ( c=width/4; c; --c ) {
   1.891 -				/* Pack RGB into 8bit pixel */
   1.892 -				RGB888_RGB332(Pixel, *src);
   1.893 -				*dst++ = map[Pixel];
   1.894 -				++src;
   1.895 -				RGB888_RGB332(Pixel, *src);
   1.896 -				*dst++ = map[Pixel];
   1.897 -				++src;
   1.898 -				RGB888_RGB332(Pixel, *src);
   1.899 -				*dst++ = map[Pixel];
   1.900 -				++src;
   1.901 -				RGB888_RGB332(Pixel, *src);
   1.902 -				*dst++ = map[Pixel];
   1.903 -				++src;
   1.904 -			}
   1.905 -			switch ( width & 3 ) {
   1.906 -				case 3:
   1.907 -					RGB888_RGB332(Pixel, *src);
   1.908 -					*dst++ = map[Pixel];
   1.909 -					++src;
   1.910 -				case 2:
   1.911 -					RGB888_RGB332(Pixel, *src);
   1.912 -					*dst++ = map[Pixel];
   1.913 -					++src;
   1.914 -				case 1:
   1.915 -					RGB888_RGB332(Pixel, *src);
   1.916 -					*dst++ = map[Pixel];
   1.917 -					++src;
   1.918 -			}
   1.919 +            for (c = width / 4; c; --c) {
   1.920 +                /* Pack RGB into 8bit pixel */
   1.921 +                RGB888_RGB332(Pixel, *src);
   1.922 +                *dst++ = map[Pixel];
   1.923 +                ++src;
   1.924 +                RGB888_RGB332(Pixel, *src);
   1.925 +                *dst++ = map[Pixel];
   1.926 +                ++src;
   1.927 +                RGB888_RGB332(Pixel, *src);
   1.928 +                *dst++ = map[Pixel];
   1.929 +                ++src;
   1.930 +                RGB888_RGB332(Pixel, *src);
   1.931 +                *dst++ = map[Pixel];
   1.932 +                ++src;
   1.933 +            }
   1.934 +            switch (width & 3) {
   1.935 +            case 3:
   1.936 +                RGB888_RGB332(Pixel, *src);
   1.937 +                *dst++ = map[Pixel];
   1.938 +                ++src;
   1.939 +            case 2:
   1.940 +                RGB888_RGB332(Pixel, *src);
   1.941 +                *dst++ = map[Pixel];
   1.942 +                ++src;
   1.943 +            case 1:
   1.944 +                RGB888_RGB332(Pixel, *src);
   1.945 +                *dst++ = map[Pixel];
   1.946 +                ++src;
   1.947 +            }
   1.948  #endif /* USE_DUFFS_LOOP */
   1.949 -			src += srcskip;
   1.950 -			dst += dstskip;
   1.951 -		}
   1.952 -	}
   1.953 +            src += srcskip;
   1.954 +            dst += dstskip;
   1.955 +        }
   1.956 +    }
   1.957  }
   1.958 +
   1.959  /* Special optimized blit for RGB 8-8-8 --> RGB 5-5-5 */
   1.960  #define RGB888_RGB555(dst, src) { \
   1.961  	*(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>9)| \
   1.962 @@ -981,112 +1016,116 @@
   1.963  	                     (((src[LO])&0x0000F800)>>6)| \
   1.964  	                     (((src[LO])&0x000000F8)>>3); \
   1.965  }
   1.966 -static void Blit_RGB888_RGB555(SDL_BlitInfo *info)
   1.967 +static void
   1.968 +Blit_RGB888_RGB555(SDL_BlitInfo * info)
   1.969  {
   1.970  #ifndef USE_DUFFS_LOOP
   1.971 -	int c;
   1.972 +    int c;
   1.973  #endif
   1.974 -	int width, height;
   1.975 -	Uint32 *src;
   1.976 -	Uint16 *dst;
   1.977 -	int srcskip, dstskip;
   1.978 +    int width, height;
   1.979 +    Uint32 *src;
   1.980 +    Uint16 *dst;
   1.981 +    int srcskip, dstskip;
   1.982  
   1.983 -	/* Set up some basic variables */
   1.984 -	width = info->d_width;
   1.985 -	height = info->d_height;
   1.986 -	src = (Uint32 *)info->s_pixels;
   1.987 -	srcskip = info->s_skip/4;
   1.988 -	dst = (Uint16 *)info->d_pixels;
   1.989 -	dstskip = info->d_skip/2;
   1.990 +    /* Set up some basic variables */
   1.991 +    width = info->d_width;
   1.992 +    height = info->d_height;
   1.993 +    src = (Uint32 *) info->s_pixels;
   1.994 +    srcskip = info->s_skip / 4;
   1.995 +    dst = (Uint16 *) info->d_pixels;
   1.996 +    dstskip = info->d_skip / 2;
   1.997  
   1.998  #ifdef USE_DUFFS_LOOP
   1.999 -	while ( height-- ) {
  1.1000 +    while (height--) {
  1.1001 +		/* *INDENT-OFF* */
  1.1002  		DUFFS_LOOP(
  1.1003  			RGB888_RGB555(dst, src);
  1.1004  			++src;
  1.1005  			++dst;
  1.1006  		, width);
  1.1007 -		src += srcskip;
  1.1008 -		dst += dstskip;
  1.1009 -	}
  1.1010 +		/* *INDENT-ON* */
  1.1011 +        src += srcskip;
  1.1012 +        dst += dstskip;
  1.1013 +    }
  1.1014  #else
  1.1015 -	/* Memory align at 4-byte boundary, if necessary */
  1.1016 -	if ( (long)dst & 0x03 ) {
  1.1017 -		/* Don't do anything if width is 0 */
  1.1018 -		if ( width == 0 ) {
  1.1019 -			return;
  1.1020 -		}
  1.1021 -		--width;
  1.1022 +    /* Memory align at 4-byte boundary, if necessary */
  1.1023 +    if ((long) dst & 0x03) {
  1.1024 +        /* Don't do anything if width is 0 */
  1.1025 +        if (width == 0) {
  1.1026 +            return;
  1.1027 +        }
  1.1028 +        --width;
  1.1029  
  1.1030 -		while ( height-- ) {
  1.1031 -			/* Perform copy alignment */
  1.1032 -			RGB888_RGB555(dst, src);
  1.1033 -			++src;
  1.1034 -			++dst;
  1.1035 +        while (height--) {
  1.1036 +            /* Perform copy alignment */
  1.1037 +            RGB888_RGB555(dst, src);
  1.1038 +            ++src;
  1.1039 +            ++dst;
  1.1040  
  1.1041 -			/* Copy in 4 pixel chunks */
  1.1042 -			for ( c=width/4; c; --c ) {
  1.1043 -				RGB888_RGB555_TWO(dst, src);
  1.1044 -				src += 2;
  1.1045 -				dst += 2;
  1.1046 -				RGB888_RGB555_TWO(dst, src);
  1.1047 -				src += 2;
  1.1048 -				dst += 2;
  1.1049 -			}
  1.1050 -			/* Get any leftovers */
  1.1051 -			switch (width & 3) {
  1.1052 -				case 3:
  1.1053 -					RGB888_RGB555(dst, src);
  1.1054 -					++src;
  1.1055 -					++dst;
  1.1056 -				case 2:
  1.1057 -					RGB888_RGB555_TWO(dst, src);
  1.1058 -					src += 2;
  1.1059 -					dst += 2;
  1.1060 -					break;
  1.1061 -				case 1:
  1.1062 -					RGB888_RGB555(dst, src);
  1.1063 -					++src;
  1.1064 -					++dst;
  1.1065 -					break;
  1.1066 -			}
  1.1067 -			src += srcskip;
  1.1068 -			dst += dstskip;
  1.1069 -		}
  1.1070 -	} else { 
  1.1071 -		while ( height-- ) {
  1.1072 -			/* Copy in 4 pixel chunks */
  1.1073 -			for ( c=width/4; c; --c ) {
  1.1074 -				RGB888_RGB555_TWO(dst, src);
  1.1075 -				src += 2;
  1.1076 -				dst += 2;
  1.1077 -				RGB888_RGB555_TWO(dst, src);
  1.1078 -				src += 2;
  1.1079 -				dst += 2;
  1.1080 -			}
  1.1081 -			/* Get any leftovers */
  1.1082 -			switch (width & 3) {
  1.1083 -				case 3:
  1.1084 -					RGB888_RGB555(dst, src);
  1.1085 -					++src;
  1.1086 -					++dst;
  1.1087 -				case 2:
  1.1088 -					RGB888_RGB555_TWO(dst, src);
  1.1089 -					src += 2;
  1.1090 -					dst += 2;
  1.1091 -					break;
  1.1092 -				case 1:
  1.1093 -					RGB888_RGB555(dst, src);
  1.1094 -					++src;
  1.1095 -					++dst;
  1.1096 -					break;
  1.1097 -			}
  1.1098 -			src += srcskip;
  1.1099 -			dst += dstskip;
  1.1100 -		}
  1.1101 -	}
  1.1102 +            /* Copy in 4 pixel chunks */
  1.1103 +            for (c = width / 4; c; --c) {
  1.1104 +                RGB888_RGB555_TWO(dst, src);
  1.1105 +                src += 2;
  1.1106 +                dst += 2;
  1.1107 +                RGB888_RGB555_TWO(dst, src);
  1.1108 +                src += 2;
  1.1109 +                dst += 2;
  1.1110 +            }
  1.1111 +            /* Get any leftovers */
  1.1112 +            switch (width & 3) {
  1.1113 +            case 3:
  1.1114 +                RGB888_RGB555(dst, src);
  1.1115 +                ++src;
  1.1116 +                ++dst;
  1.1117 +            case 2:
  1.1118 +                RGB888_RGB555_TWO(dst, src);
  1.1119 +                src += 2;
  1.1120 +                dst += 2;
  1.1121 +                break;
  1.1122 +            case 1:
  1.1123 +                RGB888_RGB555(dst, src);
  1.1124 +                ++src;
  1.1125 +                ++dst;
  1.1126 +                break;
  1.1127 +            }
  1.1128 +            src += srcskip;
  1.1129 +            dst += dstskip;
  1.1130 +        }
  1.1131 +    } else {
  1.1132 +        while (height--) {
  1.1133 +            /* Copy in 4 pixel chunks */
  1.1134 +            for (c = width / 4; c; --c) {
  1.1135 +                RGB888_RGB555_TWO(dst, src);
  1.1136 +                src += 2;
  1.1137 +                dst += 2;
  1.1138 +                RGB888_RGB555_TWO(dst, src);
  1.1139 +                src += 2;
  1.1140 +                dst += 2;
  1.1141 +            }
  1.1142 +            /* Get any leftovers */
  1.1143 +            switch (width & 3) {
  1.1144 +            case 3:
  1.1145 +                RGB888_RGB555(dst, src);
  1.1146 +                ++src;
  1.1147 +                ++dst;
  1.1148 +            case 2:
  1.1149 +                RGB888_RGB555_TWO(dst, src);
  1.1150 +                src += 2;
  1.1151 +                dst += 2;
  1.1152 +                break;
  1.1153 +            case 1:
  1.1154 +                RGB888_RGB555(dst, src);
  1.1155 +                ++src;
  1.1156 +                ++dst;
  1.1157 +                break;
  1.1158 +            }
  1.1159 +            src += srcskip;
  1.1160 +            dst += dstskip;
  1.1161 +        }
  1.1162 +    }
  1.1163  #endif /* USE_DUFFS_LOOP */
  1.1164  }
  1.1165 +
  1.1166  /* Special optimized blit for RGB 8-8-8 --> RGB 5-6-5 */
  1.1167  #define RGB888_RGB565(dst, src) { \
  1.1168  	*(Uint16 *)(dst) = (Uint16)((((*src)&0x00F80000)>>8)| \
  1.1169 @@ -1101,110 +1140,113 @@
  1.1170  	                     (((src[LO])&0x0000FC00)>>5)| \
  1.1171  	                     (((src[LO])&0x000000F8)>>3); \
  1.1172  }
  1.1173 -static void Blit_RGB888_RGB565(SDL_BlitInfo *info)
  1.1174 +static void
  1.1175 +Blit_RGB888_RGB565(SDL_BlitInfo * info)
  1.1176  {
  1.1177  #ifndef USE_DUFFS_LOOP
  1.1178 -	int c;
  1.1179 +    int c;
  1.1180  #endif
  1.1181 -	int width, height;
  1.1182 -	Uint32 *src;
  1.1183 -	Uint16 *dst;
  1.1184 -	int srcskip, dstskip;
  1.1185 +    int width, height;
  1.1186 +    Uint32 *src;
  1.1187 +    Uint16 *dst;
  1.1188 +    int srcskip, dstskip;
  1.1189  
  1.1190 -	/* Set up some basic variables */
  1.1191 -	width = info->d_width;
  1.1192 -	height = info->d_height;
  1.1193 -	src = (Uint32 *)info->s_pixels;
  1.1194 -	srcskip = info->s_skip/4;
  1.1195 -	dst = (Uint16 *)info->d_pixels;
  1.1196 -	dstskip = info->d_skip/2;
  1.1197 +    /* Set up some basic variables */
  1.1198 +    width = info->d_width;
  1.1199 +    height = info->d_height;
  1.1200 +    src = (Uint32 *) info->s_pixels;
  1.1201 +    srcskip = info->s_skip / 4;
  1.1202 +    dst = (Uint16 *) info->d_pixels;
  1.1203 +    dstskip = info->d_skip / 2;
  1.1204  
  1.1205  #ifdef USE_DUFFS_LOOP
  1.1206 -	while ( height-- ) {
  1.1207 +    while (height--) {
  1.1208 +		/* *INDENT-OFF* */
  1.1209  		DUFFS_LOOP(
  1.1210  			RGB888_RGB565(dst, src);
  1.1211  			++src;
  1.1212  			++dst;
  1.1213  		, width);
  1.1214 -		src += srcskip;
  1.1215 -		dst += dstskip;
  1.1216 -	}
  1.1217 +		/* *INDENT-ON* */
  1.1218 +        src += srcskip;
  1.1219 +        dst += dstskip;
  1.1220 +    }
  1.1221  #else
  1.1222 -	/* Memory align at 4-byte boundary, if necessary */
  1.1223 -	if ( (long)dst & 0x03 ) {
  1.1224 -		/* Don't do anything if width is 0 */
  1.1225 -		if ( width == 0 ) {
  1.1226 -			return;
  1.1227 -		}
  1.1228 -		--width;
  1.1229 +    /* Memory align at 4-byte boundary, if necessary */
  1.1230 +    if ((long) dst & 0x03) {
  1.1231 +        /* Don't do anything if width is 0 */
  1.1232 +        if (width == 0) {
  1.1233 +            return;
  1.1234 +        }
  1.1235 +        --width;
  1.1236  
  1.1237 -		while ( height-- ) {
  1.1238 -			/* Perform copy alignment */
  1.1239 -			RGB888_RGB565(dst, src);
  1.1240 -			++src;
  1.1241 -			++dst;
  1.1242 +        while (height--) {
  1.1243 +            /* Perform copy alignment */
  1.1244 +            RGB888_RGB565(dst, src);
  1.1245 +            ++src;
  1.1246 +            ++dst;
  1.1247  
  1.1248 -			/* Copy in 4 pixel chunks */
  1.1249 -			for ( c=width/4; c; --c ) {
  1.1250 -				RGB888_RGB565_TWO(dst, src);
  1.1251 -				src += 2;
  1.1252 -				dst += 2;
  1.1253 -				RGB888_RGB565_TWO(dst, src);
  1.1254 -				src += 2;
  1.1255 -				dst += 2;
  1.1256 -			}
  1.1257 -			/* Get any leftovers */
  1.1258 -			switch (width & 3) {
  1.1259 -				case 3:
  1.1260 -					RGB888_RGB565(dst, src);
  1.1261 -					++src;
  1.1262 -					++dst;
  1.1263 -				case 2:
  1.1264 -					RGB888_RGB565_TWO(dst, src);
  1.1265 -					src += 2;
  1.1266 -					dst += 2;
  1.1267 -					break;
  1.1268 -				case 1:
  1.1269 -					RGB888_RGB565(dst, src);
  1.1270 -					++src;
  1.1271 -					++dst;
  1.1272 -					break;
  1.1273 -			}
  1.1274 -			src += srcskip;
  1.1275 -			dst += dstskip;
  1.1276 -		}
  1.1277 -	} else { 
  1.1278 -		while ( height-- ) {
  1.1279 -			/* Copy in 4 pixel chunks */
  1.1280 -			for ( c=width/4; c; --c ) {
  1.1281 -				RGB888_RGB565_TWO(dst, src);
  1.1282 -				src += 2;
  1.1283 -				dst += 2;
  1.1284 -				RGB888_RGB565_TWO(dst, src);
  1.1285 -				src += 2;
  1.1286 -				dst += 2;
  1.1287 -			}
  1.1288 -			/* Get any leftovers */
  1.1289 -			switch (width & 3) {
  1.1290 -				case 3:
  1.1291 -					RGB888_RGB565(dst, src);
  1.1292 -					++src;
  1.1293 -					++dst;
  1.1294 -				case 2:
  1.1295 -					RGB888_RGB565_TWO(dst, src);
  1.1296 -					src += 2;
  1.1297 -					dst += 2;
  1.1298 -					break;
  1.1299 -				case 1:
  1.1300 -					RGB888_RGB565(dst, src);
  1.1301 -					++src;
  1.1302 -					++dst;
  1.1303 -					break;
  1.1304 -			}
  1.1305 -			src += srcskip;
  1.1306 -			dst += dstskip;
  1.1307 -		}
  1.1308 -	}
  1.1309 +            /* Copy in 4 pixel chunks */
  1.1310 +            for (c = width / 4; c; --c) {
  1.1311 +                RGB888_RGB565_TWO(dst, src);
  1.1312 +                src += 2;
  1.1313 +                dst += 2;
  1.1314 +                RGB888_RGB565_TWO(dst, src);
  1.1315 +                src += 2;
  1.1316 +                dst += 2;
  1.1317 +            }
  1.1318 +            /* Get any leftovers */
  1.1319 +            switch (width & 3) {
  1.1320 +            case 3:
  1.1321 +                RGB888_RGB565(dst, src);
  1.1322 +                ++src;
  1.1323 +                ++dst;
  1.1324 +            case 2:
  1.1325 +                RGB888_RGB565_TWO(dst, src);
  1.1326 +                src += 2;
  1.1327 +                dst += 2;
  1.1328 +                break;
  1.1329 +            case 1:
  1.1330 +                RGB888_RGB565(dst, src);
  1.1331 +                ++src;
  1.1332 +                ++dst;
  1.1333 +                break;
  1.1334 +            }
  1.1335 +            src += srcskip;
  1.1336 +            dst += dstskip;
  1.1337 +        }
  1.1338 +    } else {
  1.1339 +        while (height--) {
  1.1340 +            /* Copy in 4 pixel chunks */
  1.1341 +            for (c = width / 4; c; --c) {
  1.1342 +                RGB888_RGB565_TWO(dst, src);
  1.1343 +                src += 2;
  1.1344 +                dst += 2;
  1.1345 +                RGB888_RGB565_TWO(dst, src);
  1.1346 +                src += 2;
  1.1347 +                dst += 2;
  1.1348 +            }
  1.1349 +            /* Get any leftovers */
  1.1350 +            switch (width & 3) {
  1.1351 +            case 3:
  1.1352 +                RGB888_RGB565(dst, src);
  1.1353 +                ++src;
  1.1354 +                ++dst;
  1.1355 +            case 2:
  1.1356 +                RGB888_RGB565_TWO(dst, src);
  1.1357 +                src += 2;
  1.1358 +                dst += 2;
  1.1359 +                break;
  1.1360 +            case 1:
  1.1361 +                RGB888_RGB565(dst, src);
  1.1362 +                ++src;
  1.1363 +                ++dst;
  1.1364 +                break;
  1.1365 +            }
  1.1366 +            src += srcskip;
  1.1367 +            dst += dstskip;
  1.1368 +        }
  1.1369 +    }
  1.1370  #endif /* USE_DUFFS_LOOP */
  1.1371  }
  1.1372  
  1.1373 @@ -1213,607 +1255,614 @@
  1.1374  
  1.1375  /* Special optimized blit for RGB 5-6-5 --> 32-bit RGB surfaces */
  1.1376  #define RGB565_32(dst, src, map) (map[src[LO]*2] + map[src[HI]*2+1])
  1.1377 -static void Blit_RGB565_32(SDL_BlitInfo *info, const Uint32 *map)
  1.1378 +static void
  1.1379 +Blit_RGB565_32(SDL_BlitInfo * info, const Uint32 * map)
  1.1380  {
  1.1381  #ifndef USE_DUFFS_LOOP
  1.1382 -	int c;
  1.1383 +    int c;
  1.1384  #endif
  1.1385 -	int width, height;
  1.1386 -	Uint8 *src;
  1.1387 -	Uint32 *dst;
  1.1388 -	int srcskip, dstskip;
  1.1389 +    int width, height;
  1.1390 +    Uint8 *src;
  1.1391 +    Uint32 *dst;
  1.1392 +    int srcskip, dstskip;
  1.1393  
  1.1394 -	/* Set up some basic variables */
  1.1395 -	width = info->d_width;
  1.1396 -	height = info->d_height;
  1.1397 -	src = (Uint8 *)info->s_pixels;
  1.1398 -	srcskip = info->s_skip;
  1.1399 -	dst = (Uint32 *)info->d_pixels;
  1.1400 -	dstskip = info->d_skip/4;
  1.1401 +    /* Set up some basic variables */
  1.1402 +    width = info->d_width;
  1.1403 +    height = info->d_height;
  1.1404 +    src = (Uint8 *) info->s_pixels;
  1.1405 +    srcskip = info->s_skip;
  1.1406 +    dst = (Uint32 *) info->d_pixels;
  1.1407 +    dstskip = info->d_skip / 4;
  1.1408  
  1.1409  #ifdef USE_DUFFS_LOOP
  1.1410 -	while ( height-- ) {
  1.1411 +    while (height--) {
  1.1412 +		/* *INDENT-OFF* */
  1.1413  		DUFFS_LOOP(
  1.1414  		{
  1.1415  			*dst++ = RGB565_32(dst, src, map);
  1.1416  			src += 2;
  1.1417  		},
  1.1418  		width);
  1.1419 -		src += srcskip;
  1.1420 -		dst += dstskip;
  1.1421 -	}
  1.1422 +		/* *INDENT-ON* */
  1.1423 +        src += srcskip;
  1.1424 +        dst += dstskip;
  1.1425 +    }
  1.1426  #else
  1.1427 -	while ( height-- ) {
  1.1428 -		/* Copy in 4 pixel chunks */
  1.1429 -		for ( c=width/4; c; --c ) {
  1.1430 -			*dst++ = RGB565_32(dst, src, map);
  1.1431 -			src += 2;
  1.1432 -			*dst++ = RGB565_32(dst, src, map);
  1.1433 -			src += 2;
  1.1434 -			*dst++ = RGB565_32(dst, src, map);
  1.1435 -			src += 2;
  1.1436 -			*dst++ = RGB565_32(dst, src, map);
  1.1437 -			src += 2;
  1.1438 -		}
  1.1439 -		/* Get any leftovers */
  1.1440 -		switch (width & 3) {
  1.1441 -			case 3:
  1.1442 -				*dst++ = RGB565_32(dst, src, map);
  1.1443 -				src += 2;
  1.1444 -			case 2:
  1.1445 -				*dst++ = RGB565_32(dst, src, map);
  1.1446 -				src += 2;
  1.1447 -			case 1:
  1.1448 -				*dst++ = RGB565_32(dst, src, map);
  1.1449 -				src += 2;
  1.1450 -				break;
  1.1451 -		}
  1.1452 -		src += srcskip;
  1.1453 -		dst += dstskip;
  1.1454 -	}
  1.1455 +    while (height--) {
  1.1456 +        /* Copy in 4 pixel chunks */
  1.1457 +        for (c = width / 4; c; --c) {
  1.1458 +            *dst++ = RGB565_32(dst, src, map);
  1.1459 +            src += 2;
  1.1460 +            *dst++ = RGB565_32(dst, src, map);
  1.1461 +            src += 2;
  1.1462 +            *dst++ = RGB565_32(dst, src, map);
  1.1463 +            src += 2;
  1.1464 +            *dst++ = RGB565_32(dst, src, map);
  1.1465 +            src += 2;
  1.1466 +        }
  1.1467 +        /* Get any leftovers */
  1.1468 +        switch (width & 3) {
  1.1469 +        case 3:
  1.1470 +            *dst++ = RGB565_32(dst, src, map);
  1.1471 +            src += 2;
  1.1472 +        case 2:
  1.1473 +            *dst++ = RGB565_32(dst, src, map);
  1.1474 +            src += 2;
  1.1475 +        case 1:
  1.1476 +            *dst++ = RGB565_32(dst, src, map);
  1.1477 +            src += 2;
  1.1478 +            break;
  1.1479 +        }
  1.1480 +        src += srcskip;
  1.1481 +        dst += dstskip;
  1.1482 +    }
  1.1483  #endif /* USE_DUFFS_LOOP */
  1.1484  }
  1.1485  
  1.1486  /* Special optimized blit for RGB 5-6-5 --> ARGB 8-8-8-8 */
  1.1487  static const Uint32 RGB565_ARGB8888_LUT[512] = {
  1.1488 -		0x00000000, 0xff000000, 0x00000008, 0xff002000,
  1.1489 -		0x00000010, 0xff004000, 0x00000018, 0xff006100,
  1.1490 -		0x00000020, 0xff008100, 0x00000029, 0xff00a100,
  1.1491 -		0x00000031, 0xff00c200, 0x00000039, 0xff00e200,
  1.1492 -		0x00000041, 0xff080000, 0x0000004a, 0xff082000,
  1.1493 -		0x00000052, 0xff084000, 0x0000005a, 0xff086100,
  1.1494 -		0x00000062, 0xff088100, 0x0000006a, 0xff08a100,
  1.1495 -		0x00000073, 0xff08c200, 0x0000007b, 0xff08e200,
  1.1496 -		0x00000083, 0xff100000, 0x0000008b, 0xff102000,
  1.1497 -		0x00000094, 0xff104000, 0x0000009c, 0xff106100,
  1.1498 -		0x000000a4, 0xff108100, 0x000000ac, 0xff10a100,
  1.1499 -		0x000000b4, 0xff10c200, 0x000000bd, 0xff10e200,
  1.1500 -		0x000000c5, 0xff180000, 0x000000cd, 0xff182000,
  1.1501 -		0x000000d5, 0xff184000, 0x000000de, 0xff186100,
  1.1502 -		0x000000e6, 0xff188100, 0x000000ee, 0xff18a100,
  1.1503 -		0x000000f6, 0xff18c200, 0x000000ff, 0xff18e200,
  1.1504 -		0x00000400, 0xff200000, 0x00000408, 0xff202000,
  1.1505 -		0x00000410, 0xff204000, 0x00000418, 0xff206100,
  1.1506 -		0x00000420, 0xff208100, 0x00000429, 0xff20a100,
  1.1507 -		0x00000431, 0xff20c200, 0x00000439, 0xff20e200,
  1.1508 -		0x00000441, 0xff290000, 0x0000044a, 0xff292000,
  1.1509 -		0x00000452, 0xff294000, 0x0000045a, 0xff296100,
  1.1510 -		0x00000462, 0xff298100, 0x0000046a, 0xff29a100,
  1.1511 -		0x00000473, 0xff29c200, 0x0000047b, 0xff29e200,
  1.1512 -		0x00000483, 0xff310000, 0x0000048b, 0xff312000,
  1.1513 -		0x00000494, 0xff314000, 0x0000049c, 0xff316100,
  1.1514 -		0x000004a4, 0xff318100, 0x000004ac, 0xff31a100,
  1.1515 -		0x000004b4, 0xff31c200, 0x000004bd, 0xff31e200,
  1.1516 -		0x000004c5, 0xff390000, 0x000004cd, 0xff392000,
  1.1517 -		0x000004d5, 0xff394000, 0x000004de, 0xff396100,
  1.1518 -		0x000004e6, 0xff398100, 0x000004ee, 0xff39a100,
  1.1519 -		0x000004f6, 0xff39c200, 0x000004ff, 0xff39e200,
  1.1520 -		0x00000800, 0xff410000, 0x00000808, 0xff412000,
  1.1521 -		0x00000810, 0xff414000, 0x00000818, 0xff416100,
  1.1522 -		0x00000820, 0xff418100, 0x00000829, 0xff41a100,
  1.1523 -		0x00000831, 0xff41c200, 0x00000839, 0xff41e200,
  1.1524 -		0x00000841, 0xff4a0000, 0x0000084a, 0xff4a2000,
  1.1525 -		0x00000852, 0xff4a4000, 0x0000085a, 0xff4a6100,
  1.1526 -		0x00000862, 0xff4a8100, 0x0000086a, 0xff4aa100,
  1.1527 -		0x00000873, 0xff4ac200, 0x0000087b, 0xff4ae200,
  1.1528 -		0x00000883, 0xff520000, 0x0000088b, 0xff522000,
  1.1529 -		0x00000894, 0xff524000, 0x0000089c, 0xff526100,
  1.1530 -		0x000008a4, 0xff528100, 0x000008ac, 0xff52a100,
  1.1531 -		0x000008b4, 0xff52c200, 0x000008bd, 0xff52e200,
  1.1532 -		0x000008c5, 0xff5a0000, 0x000008cd, 0xff5a2000,
  1.1533 -		0x000008d5, 0xff5a4000, 0x000008de, 0xff5a6100,
  1.1534 -		0x000008e6, 0xff5a8100, 0x000008ee, 0xff5aa100,
  1.1535 -		0x000008f6, 0xff5ac200, 0x000008ff, 0xff5ae200,
  1.1536 -		0x00000c00, 0xff620000, 0x00000c08, 0xff622000,
  1.1537 -		0x00000c10, 0xff624000, 0x00000c18, 0xff626100,
  1.1538 -		0x00000c20, 0xff628100, 0x00000c29, 0xff62a100,
  1.1539 -		0x00000c31, 0xff62c200, 0x00000c39, 0xff62e200,
  1.1540 -		0x00000c41, 0xff6a0000, 0x00000c4a, 0xff6a2000,
  1.1541 -		0x00000c52, 0xff6a4000, 0x00000c5a, 0xff6a6100,
  1.1542 -		0x00000c62, 0xff6a8100, 0x00000c6a, 0xff6aa100,
  1.1543 -		0x00000c73, 0xff6ac200, 0x00000c7b, 0xff6ae200,
  1.1544 -		0x00000c83, 0xff730000, 0x00000c8b, 0xff732000,
  1.1545 -		0x00000c94, 0xff734000, 0x00000c9c, 0xff736100,
  1.1546 -		0x00000ca4, 0xff738100, 0x00000cac, 0xff73a100,
  1.1547 -		0x00000cb4, 0xff73c200, 0x00000cbd, 0xff73e200,
  1.1548 -		0x00000cc5, 0xff7b0000, 0x00000ccd, 0xff7b2000,
  1.1549 -		0x00000cd5, 0xff7b4000, 0x00000cde, 0xff7b6100,
  1.1550 -		0x00000ce6, 0xff7b8100, 0x00000cee, 0xff7ba100,
  1.1551 -		0x00000cf6, 0xff7bc200, 0x00000cff, 0xff7be200,
  1.1552 -		0x00001000, 0xff830000, 0x00001008, 0xff832000,
  1.1553 -		0x00001010, 0xff834000, 0x00001018, 0xff836100,
  1.1554 -		0x00001020, 0xff838100, 0x00001029, 0xff83a100,
  1.1555 -		0x00001031, 0xff83c200, 0x00001039, 0xff83e200,
  1.1556 -		0x00001041, 0xff8b0000, 0x0000104a, 0xff8b2000,
  1.1557 -		0x00001052, 0xff8b4000, 0x0000105a, 0xff8b6100,
  1.1558 -		0x00001062, 0xff8b8100, 0x0000106a, 0xff8ba100,
  1.1559 -		0x00001073, 0xff8bc200, 0x0000107b, 0xff8be200,
  1.1560 -		0x00001083, 0xff940000, 0x0000108b, 0xff942000,
  1.1561 -		0x00001094, 0xff944000, 0x0000109c, 0xff946100,
  1.1562 -		0x000010a4, 0xff948100, 0x000010ac, 0xff94a100,
  1.1563 -		0x000010b4, 0xff94c200, 0x000010bd, 0xff94e200,
  1.1564 -		0x000010c5, 0xff9c0000, 0x000010cd, 0xff9c2000,
  1.1565 -		0x000010d5, 0xff9c4000, 0x000010de, 0xff9c6100,
  1.1566 -		0x000010e6, 0xff9c8100, 0x000010ee, 0xff9ca100,
  1.1567 -		0x000010f6, 0xff9cc200, 0x000010ff, 0xff9ce200,
  1.1568 -		0x00001400, 0xffa40000, 0x00001408, 0xffa42000,
  1.1569 -		0x00001410, 0xffa44000, 0x00001418, 0xffa46100,
  1.1570 -		0x00001420, 0xffa48100, 0x00001429, 0xffa4a100,
  1.1571 -		0x00001431, 0xffa4c200, 0x00001439, 0xffa4e200,
  1.1572 -		0x00001441, 0xffac0000, 0x0000144a, 0xffac2000,
  1.1573 -		0x00001452, 0xffac4000, 0x0000145a, 0xffac6100,
  1.1574 -		0x00001462, 0xffac8100, 0x0000146a, 0xffaca100,
  1.1575 -		0x00001473, 0xffacc200, 0x0000147b, 0xfface200,
  1.1576 -		0x00001483, 0xffb40000, 0x0000148b, 0xffb42000,
  1.1577 -		0x00001494, 0xffb44000, 0x0000149c, 0xffb46100,
  1.1578 -		0x000014a4, 0xffb48100, 0x000014ac, 0xffb4a100,
  1.1579 -		0x000014b4, 0xffb4c200, 0x000014bd, 0xffb4e200,
  1.1580 -		0x000014c5, 0xffbd0000, 0x000014cd, 0xffbd2000,
  1.1581 -		0x000014d5, 0xffbd4000, 0x000014de, 0xffbd6100,
  1.1582 -		0x000014e6, 0xffbd8100, 0x000014ee, 0xffbda100,
  1.1583 -		0x000014f6, 0xffbdc200, 0x000014ff, 0xffbde200,
  1.1584 -		0x00001800, 0xffc50000, 0x00001808, 0xffc52000,
  1.1585 -		0x00001810, 0xffc54000, 0x00001818, 0xffc56100,
  1.1586 -		0x00001820, 0xffc58100, 0x00001829, 0xffc5a100,
  1.1587 -		0x00001831, 0xffc5c200, 0x00001839, 0xffc5e200,
  1.1588 -		0x00001841, 0xffcd0000, 0x0000184a, 0xffcd2000,
  1.1589 -		0x00001852, 0xffcd4000, 0x0000185a, 0xffcd6100,
  1.1590 -		0x00001862, 0xffcd8100, 0x0000186a, 0xffcda100,
  1.1591 -		0x00001873, 0xffcdc200, 0x0000187b, 0xffcde200,
  1.1592 -		0x00001883, 0xffd50000, 0x0000188b, 0xffd52000,
  1.1593 -		0x00001894, 0xffd54000, 0x0000189c, 0xffd56100,
  1.1594 -		0x000018a4, 0xffd58100, 0x000018ac, 0xffd5a100,
  1.1595 -		0x000018b4, 0xffd5c200, 0x000018bd, 0xffd5e200,
  1.1596 -		0x000018c5, 0xffde0000, 0x000018cd, 0xffde2000,
  1.1597 -		0x000018d5, 0xffde4000, 0x000018de, 0xffde6100,
  1.1598 -		0x000018e6, 0xffde8100, 0x000018ee, 0xffdea100,
  1.1599 -		0x000018f6, 0xffdec200, 0x000018ff, 0xffdee200,
  1.1600 -		0x00001c00, 0xffe60000, 0x00001c08, 0xffe62000,
  1.1601 -		0x00001c10, 0xffe64000, 0x00001c18, 0xffe66100,
  1.1602 -		0x00001c20, 0xffe68100, 0x00001c29, 0xffe6a100,
  1.1603 -		0x00001c31, 0xffe6c200, 0x00001c39, 0xffe6e200,
  1.1604 -		0x00001c41, 0xffee0000, 0x00001c4a, 0xffee2000,
  1.1605 -		0x00001c52, 0xffee4000, 0x00001c5a, 0xffee6100,
  1.1606 -		0x00001c62, 0xffee8100, 0x00001c6a, 0xffeea100,
  1.1607 -		0x00001c73, 0xffeec200, 0x00001c7b, 0xffeee200,
  1.1608 -		0x00001c83, 0xfff60000, 0x00001c8b, 0xfff62000,
  1.1609 -		0x00001c94, 0xfff64000, 0x00001c9c, 0xfff66100,
  1.1610 -		0x00001ca4, 0xfff68100, 0x00001cac, 0xfff6a100,
  1.1611 -		0x00001cb4, 0xfff6c200, 0x00001cbd, 0xfff6e200,
  1.1612 -		0x00001cc5, 0xffff0000, 0x00001ccd, 0xffff2000,
  1.1613 -		0x00001cd5, 0xffff4000, 0x00001cde, 0xffff6100,
  1.1614 -		0x00001ce6, 0xffff8100, 0x00001cee, 0xffffa100,
  1.1615 -		0x00001cf6, 0xffffc200, 0x00001cff, 0xffffe200
  1.1616 +    0x00000000, 0xff000000, 0x00000008, 0xff002000,
  1.1617 +    0x00000010, 0xff004000, 0x00000018, 0xff006100,
  1.1618 +    0x00000020, 0xff008100, 0x00000029, 0xff00a100,
  1.1619 +    0x00000031, 0xff00c200, 0x00000039, 0xff00e200,
  1.1620 +    0x00000041, 0xff080000, 0x0000004a, 0xff082000,
  1.1621 +    0x00000052, 0xff084000, 0x0000005a, 0xff086100,
  1.1622 +    0x00000062, 0xff088100, 0x0000006a, 0xff08a100,
  1.1623 +    0x00000073, 0xff08c200, 0x0000007b, 0xff08e200,
  1.1624 +    0x00000083, 0xff100000, 0x0000008b, 0xff102000,
  1.1625 +    0x00000094, 0xff104000, 0x0000009c, 0xff106100,
  1.1626 +    0x000000a4, 0xff108100, 0x000000ac, 0xff10a100,
  1.1627 +    0x000000b4, 0xff10c200, 0x000000bd, 0xff10e200,
  1.1628 +    0x000000c5, 0xff180000, 0x000000cd, 0xff182000,
  1.1629 +    0x000000d5, 0xff184000, 0x000000de, 0xff186100,
  1.1630 +    0x000000e6, 0xff188100, 0x000000ee, 0xff18a100,
  1.1631 +    0x000000f6, 0xff18c200, 0x000000ff, 0xff18e200,
  1.1632 +    0x00000400, 0xff200000, 0x00000408, 0xff202000,
  1.1633 +    0x00000410, 0xff204000, 0x00000418, 0xff206100,
  1.1634 +    0x00000420, 0xff208100, 0x00000429, 0xff20a100,
  1.1635 +    0x00000431, 0xff20c200, 0x00000439, 0xff20e200,
  1.1636 +    0x00000441, 0xff290000, 0x0000044a, 0xff292000,
  1.1637 +    0x00000452, 0xff294000, 0x0000045a, 0xff296100,
  1.1638 +    0x00000462, 0xff298100, 0x0000046a, 0xff29a100,
  1.1639 +    0x00000473, 0xff29c200, 0x0000047b, 0xff29e200,
  1.1640 +    0x00000483, 0xff310000, 0x0000048b, 0xff312000,
  1.1641 +    0x00000494, 0xff314000, 0x0000049c, 0xff316100,
  1.1642 +    0x000004a4, 0xff318100, 0x000004ac, 0xff31a100,
  1.1643 +    0x000004b4, 0xff31c200, 0x000004bd, 0xff31e200,
  1.1644 +    0x000004c5, 0xff390000, 0x000004cd, 0xff392000,
  1.1645 +    0x000004d5, 0xff394000, 0x000004de, 0xff396100,
  1.1646 +    0x000004e6, 0xff398100, 0x000004ee, 0xff39a100,
  1.1647 +    0x000004f6, 0xff39c200, 0x000004ff, 0xff39e200,
  1.1648 +    0x00000800, 0xff410000, 0x00000808, 0xff412000,
  1.1649 +    0x00000810, 0xff414000, 0x00000818, 0xff416100,
  1.1650 +    0x00000820, 0xff418100, 0x00000829, 0xff41a100,
  1.1651 +    0x00000831, 0xff41c200, 0x00000839, 0xff41e200,
  1.1652 +    0x00000841, 0xff4a0000, 0x0000084a, 0xff4a2000,
  1.1653 +    0x00000852, 0xff4a4000, 0x0000085a, 0xff4a6100,
  1.1654 +    0x00000862, 0xff4a8100, 0x0000086a, 0xff4aa100,
  1.1655 +    0x00000873, 0xff4ac200, 0x0000087b, 0xff4ae200,
  1.1656 +    0x00000883, 0xff520000, 0x0000088b, 0xff522000,
  1.1657 +    0x00000894, 0xff524000, 0x0000089c, 0xff526100,
  1.1658 +    0x000008a4, 0xff528100, 0x000008ac, 0xff52a100,
  1.1659 +    0x000008b4, 0xff52c200, 0x000008bd, 0xff52e200,
  1.1660 +    0x000008c5, 0xff5a0000, 0x000008cd, 0xff5a2000,
  1.1661 +    0x000008d5, 0xff5a4000, 0x000008de, 0xff5a6100,
  1.1662 +    0x000008e6, 0xff5a8100, 0x000008ee, 0xff5aa100,
  1.1663 +    0x000008f6, 0xff5ac200, 0x000008ff, 0xff5ae200,
  1.1664 +    0x00000c00, 0xff620000, 0x00000c08, 0xff622000,
  1.1665 +    0x00000c10, 0xff624000, 0x00000c18, 0xff626100,
  1.1666 +    0x00000c20, 0xff628100, 0x00000c29, 0xff62a100,
  1.1667 +    0x00000c31, 0xff62c200, 0x00000c39, 0xff62e200,
  1.1668 +    0x00000c41, 0xff6a0000, 0x00000c4a, 0xff6a2000,
  1.1669 +    0x00000c52, 0xff6a4000, 0x00000c5a, 0xff6a6100,
  1.1670 +    0x00000c62, 0xff6a8100, 0x00000c6a, 0xff6aa100,
  1.1671 +    0x00000c73, 0xff6ac200, 0x00000c7b, 0xff6ae200,
  1.1672 +    0x00000c83, 0xff730000, 0x00000c8b, 0xff732000,
  1.1673 +    0x00000c94, 0xff734000, 0x00000c9c, 0xff736100,
  1.1674 +    0x00000ca4, 0xff738100, 0x00000cac, 0xff73a100,
  1.1675 +    0x00000cb4, 0xff73c200, 0x00000cbd, 0xff73e200,
  1.1676 +    0x00000cc5, 0xff7b0000, 0x00000ccd, 0xff7b2000,
  1.1677 +    0x00000cd5, 0xff7b4000, 0x00000cde, 0xff7b6100,
  1.1678 +    0x00000ce6, 0xff7b8100, 0x00000cee, 0xff7ba100,
  1.1679 +    0x00000cf6, 0xff7bc200, 0x00000cff, 0xff7be200,
  1.1680 +    0x00001000, 0xff830000, 0x00001008, 0xff832000,
  1.1681 +    0x00001010, 0xff834000, 0x00001018, 0xff836100,
  1.1682 +    0x00001020, 0xff838100, 0x00001029, 0xff83a100,
  1.1683 +    0x00001031, 0xff83c200, 0x00001039, 0xff83e200,
  1.1684 +    0x00001041, 0xff8b0000, 0x0000104a, 0xff8b2000,
  1.1685 +    0x00001052, 0xff8b4000, 0x0000105a, 0xff8b6100,
  1.1686 +    0x00001062, 0xff8b8100, 0x0000106a, 0xff8ba100,
  1.1687 +    0x00001073, 0xff8bc200, 0x0000107b, 0xff8be200,
  1.1688 +    0x00001083, 0xff940000, 0x0000108b, 0xff942000,
  1.1689 +    0x00001094, 0xff944000, 0x0000109c, 0xff946100,
  1.1690 +    0x000010a4, 0xff948100, 0x000010ac, 0xff94a100,
  1.1691 +    0x000010b4, 0xff94c200, 0x000010bd, 0xff94e200,
  1.1692 +    0x000010c5, 0xff9c0000, 0x000010cd, 0xff9c2000,
  1.1693 +    0x000010d5, 0xff9c4000, 0x000010de, 0xff9c6100,
  1.1694 +    0x000010e6, 0xff9c8100, 0x000010ee, 0xff9ca100,
  1.1695 +    0x000010f6, 0xff9cc200, 0x000010ff, 0xff9ce200,
  1.1696 +    0x00001400, 0xffa40000, 0x00001408, 0xffa42000,
  1.1697 +    0x00001410, 0xffa44000, 0x00001418, 0xffa46100,
  1.1698 +    0x00001420, 0xffa48100, 0x00001429, 0xffa4a100,
  1.1699 +    0x00001431, 0xffa4c200, 0x00001439, 0xffa4e200,
  1.1700 +    0x00001441, 0xffac0000, 0x0000144a, 0xffac2000,
  1.1701 +    0x00001452, 0xffac4000, 0x0000145a, 0xffac6100,
  1.1702 +    0x00001462, 0xffac8100, 0x0000146a, 0xffaca100,
  1.1703 +    0x00001473, 0xffacc200, 0x0000147b, 0xfface200,
  1.1704 +    0x00001483, 0xffb40000, 0x0000148b, 0xffb42000,
  1.1705 +    0x00001494, 0xffb44000, 0x0000149c, 0xffb46100,
  1.1706 +    0x000014a4, 0xffb48100, 0x000014ac, 0xffb4a100,
  1.1707 +    0x000014b4, 0xffb4c200, 0x000014bd, 0xffb4e200,
  1.1708 +    0x000014c5, 0xffbd0000, 0x000014cd, 0xffbd2000,
  1.1709 +    0x000014d5, 0xffbd4000, 0x000014de, 0xffbd6100,
  1.1710 +    0x000014e6, 0xffbd8100, 0x000014ee, 0xffbda100,
  1.1711 +    0x000014f6, 0xffbdc200, 0x000014ff, 0xffbde200,
  1.1712 +    0x00001800, 0xffc50000, 0x00001808, 0xffc52000,
  1.1713 +    0x00001810, 0xffc54000, 0x00001818, 0xffc56100,
  1.1714 +    0x00001820, 0xffc58100, 0x00001829, 0xffc5a100,
  1.1715 +    0x00001831, 0xffc5c200, 0x00001839, 0xffc5e200,
  1.1716 +    0x00001841, 0xffcd0000, 0x0000184a, 0xffcd2000,
  1.1717 +    0x00001852, 0xffcd4000, 0x0000185a, 0xffcd6100,
  1.1718 +    0x00001862, 0xffcd8100, 0x0000186a, 0xffcda100,
  1.1719 +    0x00001873, 0xffcdc200, 0x0000187b, 0xffcde200,
  1.1720 +    0x00001883, 0xffd50000, 0x0000188b, 0xffd52000,
  1.1721 +    0x00001894, 0xffd54000, 0x0000189c, 0xffd56100,
  1.1722 +    0x000018a4, 0xffd58100, 0x000018ac, 0xffd5a100,
  1.1723 +    0x000018b4, 0xffd5c200, 0x000018bd, 0xffd5e200,
  1.1724 +    0x000018c5, 0xffde0000, 0x000018cd, 0xffde2000,
  1.1725 +    0x000018d5, 0xffde4000, 0x000018de, 0xffde6100,
  1.1726 +    0x000018e6, 0xffde8100, 0x000018ee, 0xffdea100,
  1.1727 +    0x000018f6, 0xffdec200, 0x000018ff, 0xffdee200,
  1.1728 +    0x00001c00, 0xffe60000, 0x00001c08, 0xffe62000,
  1.1729 +    0x00001c10, 0xffe64000, 0x00001c18, 0xffe66100,
  1.1730 +    0x00001c20, 0xffe68100, 0x00001c29, 0xffe6a100,
  1.1731 +    0x00001c31, 0xffe6c200, 0x00001c39, 0xffe6e200,
  1.1732 +    0x00001c41, 0xffee0000, 0x00001c4a, 0xffee2000,
  1.1733 +    0x00001c52, 0xffee4000, 0x00001c5a, 0xffee6100,
  1.1734 +    0x00001c62, 0xffee8100, 0x00001c6a, 0xffeea100,
  1.1735 +    0x00001c73, 0xffeec200, 0x00001c7b, 0xffeee200,
  1.1736 +    0x00001c83, 0xfff60000, 0x00001c8b, 0xfff62000,
  1.1737 +    0x00001c94, 0xfff64000, 0x00001c9c, 0xfff66100,
  1.1738 +    0x00001ca4, 0xfff68100, 0x00001cac, 0xfff6a100,
  1.1739 +    0x00001cb4, 0xfff6c200, 0x00001cbd, 0xfff6e200,
  1.1740 +    0x00001cc5, 0xffff0000, 0x00001ccd, 0xffff2000,
  1.1741 +    0x00001cd5, 0xffff4000, 0x00001cde, 0xffff6100,
  1.1742 +    0x00001ce6, 0xffff8100, 0x00001cee, 0xffffa100,
  1.1743 +    0x00001cf6, 0xffffc200, 0x00001cff, 0xffffe200
  1.1744  };
  1.1745 -static void Blit_RGB565_ARGB8888(SDL_BlitInfo *info)
  1.1746 +static void
  1.1747 +Blit_RGB565_ARGB8888(SDL_BlitInfo * info)
  1.1748  {
  1.1749      Blit_RGB565_32(info, RGB565_ARGB8888_LUT);
  1.1750  }
  1.1751  
  1.1752  /* Special optimized blit for RGB 5-6-5 --> ABGR 8-8-8-8 */
  1.1753  static const Uint32 RGB565_ABGR8888_LUT[512] = {
  1.1754 -		0xff000000, 0x00000000, 0xff080000, 0x00002000,
  1.1755 -		0xff100000, 0x00004000, 0xff180000, 0x00006100,
  1.1756 -		0xff200000, 0x00008100, 0xff290000, 0x0000a100,
  1.1757 -		0xff310000, 0x0000c200, 0xff390000, 0x0000e200,
  1.1758 -		0xff410000, 0x00000008, 0xff4a0000, 0x00002008,
  1.1759 -		0xff520000, 0x00004008, 0xff5a0000, 0x00006108,
  1.1760 -		0xff620000, 0x00008108, 0xff6a0000, 0x0000a108,
  1.1761 -		0xff730000, 0x0000c208, 0xff7b0000, 0x0000e208,
  1.1762 -		0xff830000, 0x00000010, 0xff8b0000, 0x00002010,
  1.1763 -		0xff940000, 0x00004010, 0xff9c0000, 0x00006110,
  1.1764 -		0xffa40000, 0x00008110, 0xffac0000, 0x0000a110,
  1.1765 -		0xffb40000, 0x0000c210, 0xffbd0000, 0x0000e210,
  1.1766 -		0xffc50000, 0x00000018, 0xffcd0000, 0x00002018,
  1.1767 -		0xffd50000, 0x00004018, 0xffde0000, 0x00006118,
  1.1768 -		0xffe60000, 0x00008118, 0xffee0000, 0x0000a118,
  1.1769 -		0xfff60000, 0x0000c218, 0xffff0000, 0x0000e218,
  1.1770 -		0xff000400, 0x00000020, 0xff080400, 0x00002020,
  1.1771 -		0xff100400, 0x00004020, 0xff180400, 0x00006120,
  1.1772 -		0xff200400, 0x00008120, 0xff290400, 0x0000a120,
  1.1773 -		0xff310400, 0x0000c220, 0xff390400, 0x0000e220,
  1.1774 -		0xff410400, 0x00000029, 0xff4a0400, 0x00002029,
  1.1775 -		0xff520400, 0x00004029, 0xff5a0400, 0x00006129,
  1.1776 -		0xff620400, 0x00008129, 0xff6a0400, 0x0000a129,
  1.1777 -		0xff730400, 0x0000c229, 0xff7b0400, 0x0000e229,
  1.1778 -		0xff830400, 0x00000031, 0xff8b0400, 0x00002031,
  1.1779 -		0xff940400, 0x00004031, 0xff9c0400, 0x00006131,
  1.1780 -		0xffa40400, 0x00008131, 0xffac0400, 0x0000a131,
  1.1781 -		0xffb40400, 0x0000c231, 0xffbd0400, 0x0000e231,
  1.1782 -		0xffc50400, 0x00000039, 0xffcd0400, 0x00002039,
  1.1783 -		0xffd50400, 0x00004039, 0xffde0400, 0x00006139,
  1.1784 -		0xffe60400, 0x00008139, 0xffee0400, 0x0000a139,
  1.1785 -		0xfff60400, 0x0000c239, 0xffff0400, 0x0000e239,
  1.1786 -		0xff000800, 0x00000041, 0xff080800, 0x00002041,
  1.1787 -		0xff100800, 0x00004041, 0xff180800, 0x00006141,
  1.1788 -		0xff200800, 0x00008141, 0xff290800, 0x0000a141,
  1.1789 -		0xff310800, 0x0000c241, 0xff390800, 0x0000e241,
  1.1790 -		0xff410800, 0x0000004a, 0xff4a0800, 0x0000204a,
  1.1791 -		0xff520800, 0x0000404a, 0xff5a0800, 0x0000614a,
  1.1792 -		0xff620800, 0x0000814a, 0xff6a0800, 0x0000a14a,
  1.1793 -		0xff730800, 0x0000c24a, 0xff7b0800, 0x0000e24a,
  1.1794 -		0xff830800, 0x00000052, 0xff8b0800, 0x00002052,
  1.1795 -		0xff940800, 0x00004052, 0xff9c0800, 0x00006152,
  1.1796 -		0xffa40800, 0x00008152, 0xffac0800, 0x0000a152,
  1.1797 -		0xffb40800, 0x0000c252, 0xffbd0800, 0x0000e252,
  1.1798 -		0xffc50800, 0x0000005a, 0xffcd0800, 0x0000205a,
  1.1799 -		0xffd50800, 0x0000405a, 0xffde0800, 0x0000615a,
  1.1800 -		0xffe60800, 0x0000815a, 0xffee0800, 0x0000a15a,
  1.1801 -		0xfff60800, 0x0000c25a, 0xffff0800, 0x0000e25a,
  1.1802 -		0xff000c00, 0x00000062, 0xff080c00, 0x00002062,
  1.1803 -		0xff100c00, 0x00004062, 0xff180c00, 0x00006162,
  1.1804 -		0xff200c00, 0x00008162, 0xff290c00, 0x0000a162,
  1.1805 -		0xff310c00, 0x0000c262, 0xff390c00, 0x0000e262,
  1.1806 -		0xff410c00, 0x0000006a, 0xff4a0c00, 0x0000206a,
  1.1807 -		0xff520c00, 0x0000406a, 0xff5a0c00, 0x0000616a,
  1.1808 -		0xff620c00, 0x0000816a, 0xff6a0c00, 0x0000a16a,
  1.1809 -		0xff730c00, 0x0000c26a, 0xff7b0c00, 0x0000e26a,
  1.1810 -		0xff830c00, 0x00000073, 0xff8b0c00, 0x00002073,
  1.1811 -		0xff940c00, 0x00004073, 0xff9c0c00, 0x00006173,
  1.1812 -		0xffa40c00, 0x00008173, 0xffac0c00, 0x0000a173,
  1.1813 -		0xffb40c00, 0x0000c273, 0xffbd0c00, 0x0000e273,
  1.1814 -		0xffc50c00, 0x0000007b, 0xffcd0c00, 0x0000207b,
  1.1815 -		0xffd50c00, 0x0000407b, 0xffde0c00, 0x0000617b,
  1.1816 -		0xffe60c00, 0x0000817b, 0xffee0c00, 0x0000a17b,
  1.1817 -		0xfff60c00, 0x0000c27b, 0xffff0c00, 0x0000e27b,
  1.1818 -		0xff001000, 0x00000083, 0xff081000, 0x00002083,
  1.1819 -		0xff101000, 0x00004083, 0xff181000, 0x00006183,
  1.1820 -		0xff201000, 0x00008183, 0xff291000, 0x0000a183,
  1.1821 -		0xff311000, 0x0000c283, 0xff391000, 0x0000e283,
  1.1822 -		0xff411000, 0x0000008b, 0xff4a1000, 0x0000208b,
  1.1823 -		0xff521000, 0x0000408b, 0xff5a1000, 0x0000618b,
  1.1824 -		0xff621000, 0x0000818b, 0xff6a1000, 0x0000a18b,
  1.1825 -		0xff731000, 0x0000c28b, 0xff7b1000, 0x0000e28b,
  1.1826 -		0xff831000, 0x00000094, 0xff8b1000, 0x00002094,
  1.1827 -		0xff941000, 0x00004094, 0xff9c1000, 0x00006194,
  1.1828 -		0xffa41000, 0x00008194, 0xffac1000, 0x0000a194,
  1.1829 -		0xffb41000, 0x0000c294, 0xffbd1000, 0x0000e294,
  1.1830 -		0xffc51000, 0x0000009c, 0xffcd1000, 0x0000209c,
  1.1831 -		0xffd51000, 0x0000409c, 0xffde1000, 0x0000619c,
  1.1832 -		0xffe61000, 0x0000819c, 0xffee1000, 0x0000a19c,
  1.1833 -		0xfff61000, 0x0000c29c, 0xffff1000, 0x0000e29c,
  1.1834 -		0xff001400, 0x000000a4, 0xff081400, 0x000020a4,
  1.1835 -		0xff101400, 0x000040a4, 0xff181400, 0x000061a4,
  1.1836 -		0xff201400, 0x000081a4, 0xff291400, 0x0000a1a4,
  1.1837 -		0xff311400, 0x0000c2a4, 0xff391400, 0x0000e2a4,
  1.1838 -		0xff411400, 0x000000ac, 0xff4a1400, 0x000020ac,
  1.1839 -		0xff521400, 0x000040ac, 0xff5a1400, 0x000061ac,
  1.1840 -		0xff621400, 0x000081ac, 0xff6a1400, 0x0000a1ac,
  1.1841 -		0xff731400, 0x0000c2ac, 0xff7b1400, 0x0000e2ac,
  1.1842 -		0xff831400, 0x000000b4, 0xff8b1400, 0x000020b4,
  1.1843 -		0xff941400, 0x000040b4, 0xff9c1400, 0x000061b4,
  1.1844 -		0xffa41400, 0x000081b4, 0xffac1400, 0x0000a1b4,
  1.1845 -		0xffb41400, 0x0000c2b4, 0xffbd1400, 0x0000e2b4,
  1.1846 -		0xffc51400, 0x000000bd, 0xffcd1400, 0x000020bd,
  1.1847 -		0xffd51400, 0x000040bd, 0xffde1400, 0x000061bd,
  1.1848 -		0xffe61400, 0x000081bd, 0xffee1400, 0x0000a1bd,
  1.1849 -		0xfff61400, 0x0000c2bd, 0xffff1400, 0x0000e2bd,
  1.1850 -		0xff001800, 0x000000c5, 0xff081800, 0x000020c5,
  1.1851 -		0xff101800, 0x000040c5, 0xff181800, 0x000061c5,
  1.1852 -		0xff201800, 0x000081c5, 0xff291800, 0x0000a1c5,
  1.1853 -		0xff311800, 0x0000c2c5, 0xff391800, 0x0000e2c5,
  1.1854 -		0xff411800, 0x000000cd, 0xff4a1800, 0x000020cd,
  1.1855 -		0xff521800, 0x000040cd, 0xff5a1800, 0x000061cd,
  1.1856 -		0xff621800, 0x000081cd, 0xff6a1800, 0x0000a1cd,
  1.1857 -		0xff731800, 0x0000c2cd, 0xff7b1800, 0x0000e2cd,
  1.1858 -		0xff831800, 0x000000d5, 0xff8b1800, 0x000020d5,
  1.1859 -		0xff941800, 0x000040d5, 0xff9c1800, 0x000061d5,
  1.1860 -		0xffa41800, 0x000081d5, 0xffac1800, 0x0000a1d5,
  1.1861 -		0xffb41800, 0x0000c2d5, 0xffbd1800, 0x0000e2d5,
  1.1862 -		0xffc51800, 0x000000de, 0xffcd1800, 0x000020de,
  1.1863 -		0xffd51800, 0x000040de, 0xffde1800, 0x000061de,
  1.1864 -		0xffe61800, 0x000081de, 0xffee1800, 0x0000a1de,
  1.1865 -		0xfff61800, 0x0000c2de, 0xffff1800, 0x0000e2de,
  1.1866 -		0xff001c00, 0x000000e6, 0xff081c00, 0x000020e6,
  1.1867 -		0xff101c00, 0x000040e6, 0xff181c00, 0x000061e6,
  1.1868 -		0xff201c00, 0x000081e6, 0xff291c00, 0x0000a1e6,
  1.1869 -		0xff311c00, 0x0000c2e6, 0xff391c00, 0x0000e2e6,
  1.1870 -		0xff411c00, 0x000000ee, 0xff4a1c00, 0x000020ee,
  1.1871 -		0xff521c00, 0x000040ee, 0xff5a1c00, 0x000061ee,
  1.1872 -		0xff621c00, 0x000081ee, 0xff6a1c00, 0x0000a1ee,
  1.1873 -		0xff731c00, 0x0000c2ee, 0xff7b1c00, 0x0000e2ee,
  1.1874 -		0xff831c00, 0x000000f6, 0xff8b1c00, 0x000020f6,
  1.1875 -		0xff941c00, 0x000040f6, 0xff9c1c00, 0x000061f6,
  1.1876 -		0xffa41c00, 0x000081f6, 0xffac1c00, 0x0000a1f6,
  1.1877 -		0xffb41c00, 0x0000c2f6, 0xffbd1c00, 0x0000e2f6,
  1.1878 -		0xffc51c00, 0x000000ff, 0xffcd1c00, 0x000020ff,
  1.1879 -		0xffd51c00, 0x000040ff, 0xffde1c00, 0x000061ff,
  1.1880 -		0xffe61c00, 0x000081ff, 0xffee1c00, 0x0000a1ff,
  1.1881 -		0xfff61c00, 0x0000c2ff, 0xffff1c00, 0x0000e2ff
  1.1882 +    0xff000000, 0x00000000, 0xff080000, 0x00002000,
  1.1883 +    0xff100000, 0x00004000, 0xff180000, 0x00006100,
  1.1884 +    0xff200000, 0x00008100, 0xff290000, 0x0000a100,
  1.1885 +    0xff310000, 0x0000c200, 0xff390000, 0x0000e200,
  1.1886 +    0xff410000, 0x00000008, 0xff4a0000, 0x00002008,
  1.1887 +    0xff520000, 0x00004008, 0xff5a0000, 0x00006108,
  1.1888 +    0xff620000, 0x00008108, 0xff6a0000, 0x0000a108,
  1.1889 +    0xff730000, 0x0000c208, 0xff7b0000, 0x0000e208,
  1.1890 +    0xff830000, 0x00000010, 0xff8b0000, 0x00002010,
  1.1891 +    0xff940000, 0x00004010, 0xff9c0000, 0x00006110,
  1.1892 +    0xffa40000, 0x00008110, 0xffac0000, 0x0000a110,
  1.1893 +    0xffb40000, 0x0000c210, 0xffbd0000, 0x0000e210,
  1.1894 +    0xffc50000, 0x00000018, 0xffcd0000, 0x00002018,
  1.1895 +    0xffd50000, 0x00004018, 0xffde0000, 0x00006118,
  1.1896 +    0xffe60000, 0x00008118, 0xffee0000, 0x0000a118,
  1.1897 +    0xfff60000, 0x0000c218, 0xffff0000, 0x0000e218,
  1.1898 +    0xff000400, 0x00000020, 0xff080400, 0x00002020,
  1.1899 +    0xff100400, 0x00004020, 0xff180400, 0x00006120,
  1.1900 +    0xff200400, 0x00008120, 0xff290400, 0x0000a120,
  1.1901 +    0xff310400, 0x0000c220, 0xff390400, 0x0000e220,
  1.1902 +    0xff410400, 0x00000029, 0xff4a0400, 0x00002029,
  1.1903 +    0xff520400, 0x00004029, 0xff5a0400, 0x00006129,
  1.1904 +    0xff620400, 0x00008129, 0xff6a0400, 0x0000a129,
  1.1905 +    0xff730400, 0x0000c229, 0xff7b0400, 0x0000e229,
  1.1906 +    0xff830400, 0x00000031, 0xff8b0400, 0x00002031,
  1.1907 +    0xff940400, 0x00004031, 0xff9c0400, 0x00006131,
  1.1908 +    0xffa40400, 0x00008131, 0xffac0400, 0x0000a131,
  1.1909 +    0xffb40400, 0x0000c231, 0xffbd0400, 0x0000e231,
  1.1910 +    0xffc50400, 0x00000039, 0xffcd0400, 0x00002039,
  1.1911 +    0xffd50400, 0x00004039, 0xffde0400, 0x00006139,
  1.1912 +    0xffe60400, 0x00008139, 0xffee0400, 0x0000a139,
  1.1913 +    0xfff60400, 0x0000c239, 0xffff0400, 0x0000e239,
  1.1914 +    0xff000800, 0x00000041, 0xff080800, 0x00002041,
  1.1915 +    0xff100800, 0x00004041, 0xff180800, 0x00006141,
  1.1916 +    0xff200800, 0x00008141, 0xff290800, 0x0000a141,
  1.1917 +    0xff310800, 0x0000c241, 0xff390800, 0x0000e241,
  1.1918 +    0xff410800, 0x0000004a, 0xff4a0800, 0x0000204a,
  1.1919 +    0xff520800, 0x0000404a, 0xff5a0800, 0x0000614a,
  1.1920 +    0xff620800, 0x0000814a, 0xff6a0800, 0x0000a14a,
  1.1921 +    0xff730800, 0x0000c24a, 0xff7b0800, 0x0000e24a,
  1.1922 +    0xff830800, 0x00000052, 0xff8b0800, 0x00002052,
  1.1923 +    0xff940800, 0x00004052, 0xff9c0800, 0x00006152,
  1.1924 +    0xffa40800, 0x00008152, 0xffac0800, 0x0000a152,
  1.1925 +    0xffb40800, 0x0000c252, 0xffbd0800, 0x0000e252,
  1.1926 +    0xffc50800, 0x0000005a, 0xffcd0800, 0x0000205a,
  1.1927 +    0xffd50800, 0x0000405a, 0xffde0800, 0x0000615a,
  1.1928 +    0xffe60800, 0x0000815a, 0xffee0800, 0x0000a15a,
  1.1929 +    0xfff60800, 0x0000c25a, 0xffff0800, 0x0000e25a,
  1.1930 +    0xff000c00, 0x00000062, 0xff080c00, 0x00002062,
  1.1931 +    0xff100c00, 0x00004062, 0xff180c00, 0x00006162,
  1.1932 +    0xff200c00, 0x00008162, 0xff290c00, 0x0000a162,
  1.1933 +    0xff310c00, 0x0000c262, 0xff390c00, 0x0000e262,
  1.1934 +    0xff410c00, 0x0000006a, 0xff4a0c00, 0x0000206a,
  1.1935 +    0xff520c00, 0x0000406a, 0xff5a0c00, 0x0000616a,
  1.1936 +    0xff620c00, 0x0000816a, 0xff6a0c00, 0x0000a16a,
  1.1937 +    0xff730c00, 0x0000c26a, 0xff7b0c00, 0x0000e26a,
  1.1938 +    0xff830c00, 0x00000073, 0xff8b0c00, 0x00002073,
  1.1939 +    0xff940c00, 0x00004073, 0xff9c0c00, 0x00006173,
  1.1940 +    0xffa40c00, 0x00008173, 0xffac0c00, 0x0000a173,
  1.1941 +    0xffb40c00, 0x0000c273, 0xffbd0c00, 0x0000e273,
  1.1942 +    0xffc50c00, 0x0000007b, 0xffcd0c00, 0x0000207b,
  1.1943 +    0xffd50c00, 0x0000407b, 0xffde0c00, 0x0000617b,
  1.1944 +    0xffe60c00, 0x0000817b, 0xffee0c00, 0x0000a17b,
  1.1945 +    0xfff60c00, 0x0000c27b, 0xffff0c00, 0x0000e27b,
  1.1946 +    0xff001000, 0x00000083, 0xff081000, 0x00002083,
  1.1947 +    0xff101000, 0x00004083, 0xff181000, 0x00006183,
  1.1948 +    0xff201000, 0x00008183, 0xff291000, 0x0000a183,
  1.1949 +    0xff311000, 0x0000c283, 0xff391000, 0x0000e283,
  1.1950 +    0xff411000, 0x0000008b, 0xff4a1000, 0x0000208b,
  1.1951 +    0xff521000, 0x0000408b, 0xff5a1000, 0x0000618b,
  1.1952 +    0xff621000, 0x0000818b, 0xff6a1000, 0x0000a18b,
  1.1953 +    0xff731000, 0x0000c28b, 0xff7b1000, 0x0000e28b,
  1.1954 +    0xff831000, 0x00000094, 0xff8b1000, 0x00002094,
  1.1955 +    0xff941000, 0x00004094, 0xff9c1000, 0x00006194,
  1.1956 +    0xffa41000, 0x00008194, 0xffac1000, 0x0000a194,
  1.1957 +    0xffb41000, 0x0000c294, 0xffbd1000, 0x0000e294,
  1.1958 +    0xffc51000, 0x0000009c, 0xffcd1000, 0x0000209c,
  1.1959 +    0xffd51000, 0x0000409c, 0xffde1000, 0x0000619c,
  1.1960 +    0xffe61000, 0x0000819c, 0xffee1000, 0x0000a19c,
  1.1961 +    0xfff61000, 0x0000c29c, 0xffff1000, 0x0000e29c,
  1.1962 +    0xff001400, 0x000000a4, 0xff081400, 0x000020a4,
  1.1963 +    0xff101400, 0x000040a4, 0xff181400, 0x000061a4,
  1.1964 +    0xff201400, 0x000081a4, 0xff291400, 0x0000a1a4,
  1.1965 +    0xff311400, 0x0000c2a4, 0xff391400, 0x0000e2a4,
  1.1966 +    0xff411400, 0x000000ac, 0xff4a1400, 0x000020ac,
  1.1967 +    0xff521400, 0x000040ac, 0xff5a1400, 0x000061ac,
  1.1968 +    0xff621400, 0x000081ac, 0xff6a1400, 0x0000a1ac,
  1.1969 +    0xff731400, 0x0000c2ac, 0xff7b1400, 0x0000e2ac,
  1.1970 +    0xff831400, 0x000000b4, 0xff8b1400, 0x000020b4,
  1.1971 +    0xff941400, 0x000040b4, 0xff9c1400, 0x000061b4,
  1.1972 +    0xffa41400, 0x000081b4, 0xffac1400, 0x0000a1b4,
  1.1973 +    0xffb41400, 0x0000c2b4, 0xffbd1400, 0x0000e2b4,
  1.1974 +    0xffc51400, 0x000000bd, 0xffcd1400, 0x000020bd,
  1.1975 +    0xffd51400, 0x000040bd, 0xffde1400, 0x000061bd,
  1.1976 +    0xffe61400, 0x000081bd, 0xffee1400, 0x0000a1bd,
  1.1977 +    0xfff61400, 0x0000c2bd, 0xffff1400, 0x0000e2bd,
  1.1978 +    0xff001800, 0x000000c5, 0xff081800, 0x000020c5,
  1.1979 +    0xff101800, 0x000040c5, 0xff181800, 0x000061c5,
  1.1980 +    0xff201800, 0x000081c5, 0xff291800, 0x0000a1c5,
  1.1981 +    0xff311800, 0x0000c2c5, 0xff391800, 0x0000e2c5,
  1.1982 +    0xff411800, 0x000000cd, 0xff4a1800, 0x000020cd,
  1.1983 +    0xff521800, 0x000040cd, 0xff5a1800, 0x000061cd,
  1.1984 +    0xff621800, 0x000081cd, 0xff6a1800, 0x0000a1cd,
  1.1985 +    0xff731800, 0x0000c2cd, 0xff7b1800, 0x0000e2cd,
  1.1986 +    0xff831800, 0x000000d5, 0xff8b1800, 0x000020d5,
  1.1987 +    0xff941800, 0x000040d5, 0xff9c1800, 0x000061d5,
  1.1988 +    0xffa41800, 0x000081d5, 0xffac1800, 0x0000a1d5,
  1.1989 +    0xffb41800, 0x0000c2d5, 0xffbd1800, 0x0000e2d5,
  1.1990 +    0xffc51800, 0x000000de, 0xffcd1800, 0x000020de,
  1.1991 +    0xffd51800, 0x000040de, 0xffde1800, 0x000061de,
  1.1992 +    0xffe61800, 0x000081de, 0xffee1800, 0x0000a1de,
  1.1993 +    0xfff61800, 0x0000c2de, 0xffff1800, 0x0000e2de,
  1.1994 +    0xff001c00, 0x000000e6, 0xff081c00, 0x000020e6,
  1.1995 +    0xff101c00, 0x000040e6, 0xff181c00, 0x000061e6,
  1.1996 +    0xff201c00, 0x000081e6, 0xff291c00, 0x0000a1e6,
  1.1997 +    0xff311c00, 0x0000c2e6, 0xff391c00, 0x0000e2e6,
  1.1998 +    0xff411c00, 0x000000ee, 0xff4a1c00, 0x000020ee,
  1.1999 +    0xff521c00, 0x000040ee, 0xff5a1c00, 0x000061ee,
  1.2000 +    0xff621c00, 0x000081ee, 0xff6a1c00, 0x0000a1ee,
  1.2001 +    0xff731c00, 0x0000c2ee, 0xff7b1c00, 0x0000e2ee,
  1.2002 +    0xff831c00, 0x000000f6, 0xff8b1c00, 0x000020f6,
  1.2003 +    0xff941c00, 0x000040f6, 0xff9c1c00, 0x000061f6,
  1.2004 +    0xffa41c00, 0x000081f6, 0xffac1c00, 0x0000a1f6,
  1.2005 +    0xffb41c00, 0x0000c2f6, 0xffbd1c00, 0x0000e2f6,
  1.2006 +    0xffc51c00, 0x000000ff, 0xffcd1c00, 0x000020ff,
  1.2007 +    0xffd51c00, 0x000040ff, 0xffde1c00, 0x000061ff,
  1.2008 +    0xffe61c00, 0x000081ff, 0xffee1c00, 0x0000a1ff,
  1.2009 +    0xfff61c00, 0x0000c2ff, 0xffff1c00, 0x0000e2ff
  1.2010  };
  1.2011 -static void Blit_RGB565_ABGR8888(SDL_BlitInfo *info)
  1.2012 +static void
  1.2013 +Blit_RGB565_ABGR8888(SDL_BlitInfo * info)
  1.2014  {
  1.2015      Blit_RGB565_32(info, RGB565_ABGR8888_LUT);
  1.2016  }
  1.2017  
  1.2018  /* Special optimized blit for RGB 5-6-5 --> RGBA 8-8-8-8 */
  1.2019  static const Uint32 RGB565_RGBA8888_LUT[512] = {
  1.2020 -		0x000000ff, 0x00000000, 0x000008ff, 0x00200000,
  1.2021 -		0x000010ff, 0x00400000, 0x000018ff, 0x00610000,
  1.2022 -		0x000020ff, 0x00810000, 0x000029ff, 0x00a10000,
  1.2023 -		0x000031ff, 0x00c20000, 0x000039ff, 0x00e20000,
  1.2024 -		0x000041ff, 0x08000000, 0x00004aff, 0x08200000,
  1.2025 -		0x000052ff, 0x08400000, 0x00005aff, 0x08610000,
  1.2026 -		0x000062ff, 0x08810000, 0x00006aff, 0x08a10000,
  1.2027 -		0x000073ff, 0x08c20000, 0x00007bff, 0x08e20000,
  1.2028 -		0x000083ff, 0x10000000, 0x00008bff, 0x10200000,
  1.2029 -		0x000094ff, 0x10400000, 0x00009cff, 0x10610000,
  1.2030 -		0x0000a4ff, 0x10810000, 0x0000acff, 0x10a10000,
  1.2031 -		0x0000b4ff, 0x10c20000, 0x0000bdff, 0x10e20000,
  1.2032 -		0x0000c5ff, 0x18000000, 0x0000cdff, 0x18200000,
  1.2033 -		0x0000d5ff, 0x18400000, 0x0000deff, 0x18610000,
  1.2034 -		0x0000e6ff, 0x18810000, 0x0000eeff, 0x18a10000,
  1.2035 -		0x0000f6ff, 0x18c20000, 0x0000ffff, 0x18e20000,
  1.2036 -		0x000400ff, 0x20000000, 0x000408ff, 0x20200000,
  1.2037 -		0x000410ff, 0x20400000, 0x000418ff, 0x20610000,
  1.2038 -		0x000420ff, 0x20810000, 0x000429ff, 0x20a10000,
  1.2039 -		0x000431ff, 0x20c20000, 0x000439ff, 0x20e20000,
  1.2040 -		0x000441ff, 0x29000000, 0x00044aff, 0x29200000,
  1.2041 -		0x000452ff, 0x29400000, 0x00045aff, 0x29610000,
  1.2042 -		0x000462ff, 0x29810000, 0x00046aff, 0x29a10000,
  1.2043 -		0x000473ff, 0x29c20000, 0x00047bff, 0x29e20000,
  1.2044 -		0x000483ff, 0x31000000, 0x00048bff, 0x31200000,
  1.2045 -		0x000494ff, 0x31400000, 0x00049cff, 0x31610000,
  1.2046 -		0x0004a4ff, 0x31810000, 0x0004acff, 0x31a10000,
  1.2047 -		0x0004b4ff, 0x31c20000, 0x0004bdff, 0x31e20000,
  1.2048 -		0x0004c5ff, 0x39000000, 0x0004cdff, 0x39200000,
  1.2049 -		0x0004d5ff, 0x39400000, 0x0004deff, 0x39610000,
  1.2050 -		0x0004e6ff, 0x39810000, 0x0004eeff, 0x39a10000,
  1.2051 -		0x0004f6ff, 0x39c20000, 0x0004ffff, 0x39e20000,
  1.2052 -		0x000800ff, 0x41000000, 0x000808ff, 0x41200000,
  1.2053 -		0x000810ff, 0x41400000, 0x000818ff, 0x41610000,
  1.2054 -		0x000820ff, 0x41810000, 0x000829ff, 0x41a10000,
  1.2055 -		0x000831ff, 0x41c20000, 0x000839ff, 0x41e20000,
  1.2056 -		0x000841ff, 0x4a000000, 0x00084aff, 0x4a200000,
  1.2057 -		0x000852ff, 0x4a400000, 0x00085aff, 0x4a610000,
  1.2058 -		0x000862ff, 0x4a810000, 0x00086aff, 0x4aa10000,
  1.2059 -		0x000873ff, 0x4ac20000, 0x00087bff, 0x4ae20000,
  1.2060 -		0x000883ff, 0x52000000, 0x00088bff, 0x52200000,
  1.2061 -		0x000894ff, 0x52400000, 0x00089cff, 0x52610000,
  1.2062 -		0x0008a4ff, 0x52810000, 0x0008acff, 0x52a10000,
  1.2063 -		0x0008b4ff, 0x52c20000, 0x0008bdff, 0x52e20000,
  1.2064 -		0x0008c5ff, 0x5a000000, 0x0008cdff, 0x5a200000,
  1.2065 -		0x0008d5ff, 0x5a400000, 0x0008deff, 0x5a610000,
  1.2066 -		0x0008e6ff, 0x5a810000, 0x0008eeff, 0x5aa10000,
  1.2067 -		0x0008f6ff, 0x5ac20000, 0x0008ffff, 0x5ae20000,
  1.2068 -		0x000c00ff, 0x62000000, 0x000c08ff, 0x62200000,
  1.2069 -		0x000c10ff, 0x62400000, 0x000c18ff, 0x62610000,
  1.2070 -		0x000c20ff, 0x62810000, 0x000c29ff, 0x62a10000,
  1.2071 -		0x000c31ff, 0x62c20000, 0x000c39ff, 0x62e20000,
  1.2072 -		0x000c41ff, 0x6a000000, 0x000c4aff, 0x6a200000,
  1.2073 -		0x000c52ff, 0x6a400000, 0x000c5aff, 0x6a610000,
  1.2074 -		0x000c62ff, 0x6a810000, 0x000c6aff, 0x6aa10000,
  1.2075 -		0x000c73ff, 0x6ac20000, 0x000c7bff, 0x6ae20000,
  1.2076 -		0x000c83ff, 0x73000000, 0x000c8bff, 0x73200000,
  1.2077 -		0x000c94ff, 0x73400000, 0x000c9cff, 0x73610000,
  1.2078 -		0x000ca4ff, 0x73810000, 0x000cacff, 0x73a10000,
  1.2079 -		0x000cb4ff, 0x73c20000, 0x000cbdff, 0x73e20000,
  1.2080 -		0x000cc5ff, 0x7b000000, 0x000ccdff, 0x7b200000,
  1.2081 -		0x000cd5ff, 0x7b400000, 0x000cdeff, 0x7b610000,
  1.2082 -		0x000ce6ff, 0x7b810000, 0x000ceeff, 0x7ba10000,
  1.2083 -		0x000cf6ff, 0x7bc20000, 0x000cffff, 0x7be20000,
  1.2084 -		0x001000ff, 0x83000000, 0x001008ff, 0x83200000,
  1.2085 -		0x001010ff, 0x83400000, 0x001018ff, 0x83610000,
  1.2086 -		0x001020ff, 0x83810000, 0x001029ff, 0x83a10000,
  1.2087 -		0x001031ff, 0x83c20000, 0x001039ff, 0x83e20000,
  1.2088 -		0x001041ff, 0x8b000000, 0x00104aff, 0x8b200000,
  1.2089 -		0x001052ff, 0x8b400000, 0x00105aff, 0x8b610000,
  1.2090 -		0x001062ff, 0x8b810000, 0x00106aff, 0x8ba10000,
  1.2091 -		0x001073ff, 0x8bc20000, 0x00107bff, 0x8be20000,
  1.2092 -		0x001083ff, 0x94000000, 0x00108bff, 0x94200000,
  1.2093 -		0x001094ff, 0x94400000, 0x00109cff, 0x94610000,
  1.2094 -		0x0010a4ff, 0x94810000, 0x0010acff, 0x94a10000,
  1.2095 -		0x0010b4ff, 0x94c20000, 0x0010bdff, 0x94e20000,
  1.2096 -		0x0010c5ff, 0x9c000000, 0x0010cdff, 0x9c200000,
  1.2097 -		0x0010d5ff, 0x9c400000, 0x0010deff, 0x9c610000,
  1.2098 -		0x0010e6ff, 0x9c810000, 0x0010eeff, 0x9ca10000,
  1.2099 -		0x0010f6ff, 0x9cc20000, 0x0010ffff, 0x9ce20000,
  1.2100 -		0x001400ff, 0xa4000000, 0x001408ff, 0xa4200000,
  1.2101 -		0x001410ff, 0xa4400000, 0x001418ff, 0xa4610000,
  1.2102 -		0x001420ff, 0xa4810000, 0x001429ff, 0xa4a10000,
  1.2103 -		0x001431ff, 0xa4c20000, 0x001439ff, 0xa4e20000,
  1.2104 -		0x001441ff, 0xac000000, 0x00144aff, 0xac200000,
  1.2105 -		0x001452ff, 0xac400000, 0x00145aff, 0xac610000,
  1.2106 -		0x001462ff, 0xac810000, 0x00146aff, 0xaca10000,
  1.2107 -		0x001473ff, 0xacc20000, 0x00147bff, 0xace20000,
  1.2108 -		0x001483ff, 0xb4000000, 0x00148bff, 0xb4200000,
  1.2109 -		0x001494ff, 0xb4400000, 0x00149cff, 0xb4610000,
  1.2110 -		0x0014a4ff, 0xb4810000, 0x0014acff, 0xb4a10000,
  1.2111 -		0x0014b4ff, 0xb4c20000, 0x0014bdff, 0xb4e20000,
  1.2112 -		0x0014c5ff, 0xbd000000, 0x0014cdff, 0xbd200000,
  1.2113 -		0x0014d5ff, 0xbd400000, 0x0014deff, 0xbd610000,
  1.2114 -		0x0014e6ff, 0xbd810000, 0x0014eeff, 0xbda10000,
  1.2115 -		0x0014f6ff, 0xbdc20000, 0x0014ffff, 0xbde20000,
  1.2116 -		0x001800ff, 0xc5000000, 0x001808ff, 0xc5200000,
  1.2117 -		0x001810ff, 0xc5400000, 0x001818ff, 0xc5610000,
  1.2118 -		0x001820ff, 0xc5810000, 0x001829ff, 0xc5a10000,
  1.2119 -		0x001831ff, 0xc5c20000, 0x001839ff, 0xc5e20000,
  1.2120 -		0x001841ff, 0xcd000000, 0x00184aff, 0xcd200000,
  1.2121 -		0x001852ff, 0xcd400000, 0x00185aff, 0xcd610000,
  1.2122 -		0x001862ff, 0xcd810000, 0x00186aff, 0xcda10000,
  1.2123 -		0x001873ff, 0xcdc20000, 0x00187bff, 0xcde20000,
  1.2124 -		0x001883ff, 0xd5000000, 0x00188bff, 0xd5200000,
  1.2125 -		0x001894ff, 0xd5400000, 0x00189cff, 0xd5610000,
  1.2126 -		0x0018a4ff, 0xd5810000, 0x0018acff, 0xd5a10000,
  1.2127 -		0x0018b4ff, 0xd5c20000, 0x0018bdff, 0xd5e20000,
  1.2128 -		0x0018c5ff, 0xde000000, 0x0018cdff, 0xde200000,
  1.2129 -		0x0018d5ff, 0xde400000, 0x0018deff, 0xde610000,
  1.2130 -		0x0018e6ff, 0xde810000, 0x0018eeff, 0xdea10000,
  1.2131 -		0x0018f6ff, 0xdec20000, 0x0018ffff, 0xdee20000,
  1.2132 -		0x001c00ff, 0xe6000000, 0x001c08ff, 0xe6200000,
  1.2133 -		0x001c10ff, 0xe6400000, 0x001c18ff, 0xe6610000,
  1.2134 -		0x001c20ff, 0xe6810000, 0x001c29ff, 0xe6a10000,
  1.2135 -		0x001c31ff, 0xe6c20000, 0x001c39ff, 0xe6e20000,
  1.2136 -		0x001c41ff, 0xee000000, 0x001c4aff, 0xee200000,
  1.2137 -		0x001c52ff, 0xee400000, 0x001c5aff, 0xee610000,
  1.2138 -		0x001c62ff, 0xee810000, 0x001c6aff, 0xeea10000,
  1.2139 -		0x001c73ff, 0xeec20000, 0x001c7bff, 0xeee20000,
  1.2140 -		0x001c83ff, 0xf6000000, 0x001c8bff, 0xf6200000,
  1.2141 -		0x001c94ff, 0xf6400000, 0x001c9cff, 0xf6610000,
  1.2142 -		0x001ca4ff, 0xf6810000, 0x001cacff, 0xf6a10000,
  1.2143 -		0x001cb4ff, 0xf6c20000, 0x001cbdff, 0xf6e20000,
  1.2144 -		0x001cc5ff, 0xff000000, 0x001ccdff, 0xff200000,
  1.2145 -		0x001cd5ff, 0xff400000, 0x001cdeff, 0xff610000,
  1.2146 -		0x001ce6ff, 0xff810000, 0x001ceeff, 0xffa10000,
  1.2147 -		0x001cf6ff, 0xffc20000, 0x001cffff, 0xffe20000,
  1.2148 +    0x000000ff, 0x00000000, 0x000008ff, 0x00200000,
  1.2149 +    0x000010ff, 0x00400000, 0x000018ff, 0x00610000,
  1.2150 +    0x000020ff, 0x00810000, 0x000029ff, 0x00a10000,
  1.2151 +    0x000031ff, 0x00c20000, 0x000039ff, 0x00e20000,
  1.2152 +    0x000041ff, 0x08000000, 0x00004aff, 0x08200000,
  1.2153 +    0x000052ff, 0x08400000, 0x00005aff, 0x08610000,
  1.2154 +    0x000062ff, 0x08810000, 0x00006aff, 0x08a10000,
  1.2155 +    0x000073ff, 0x08c20000, 0x00007bff, 0x08e20000,
  1.2156 +    0x000083ff, 0x10000000, 0x00008bff, 0x10200000,
  1.2157 +    0x000094ff, 0x10400000, 0x00009cff, 0x10610000,
  1.2158 +    0x0000a4ff, 0x10810000, 0x0000acff, 0x10a10000,
  1.2159 +    0x0000b4ff, 0x10c20000, 0x0000bdff, 0x10e20000,
  1.2160 +    0x0000c5ff, 0x18000000, 0x0000cdff, 0x18200000,
  1.2161 +    0x0000d5ff, 0x18400000, 0x0000deff, 0x18610000,
  1.2162 +    0x0000e6ff, 0x18810000, 0x0000eeff, 0x18a10000,
  1.2163 +    0x0000f6ff, 0x18c20000, 0x0000ffff, 0x18e20000,
  1.2164 +    0x000400ff, 0x20000000, 0x000408ff, 0x20200000,
  1.2165 +    0x000410ff, 0x20400000, 0x000418ff, 0x20610000,
  1.2166 +    0x000420ff, 0x20810000, 0x000429ff, 0x20a10000,
  1.2167 +    0x000431ff, 0x20c20000, 0x000439ff, 0x20e20000,
  1.2168 +    0x000441ff, 0x29000000, 0x00044aff, 0x29200000,
  1.2169 +    0x000452ff, 0x29400000, 0x00045aff, 0x29610000,
  1.2170 +    0x000462ff, 0x29810000, 0x00046aff, 0x29a10000,
  1.2171 +    0x000473ff, 0x29c20000, 0x00047bff, 0x29e20000,
  1.2172 +    0x000483ff, 0x31000000, 0x00048bff, 0x31200000,
  1.2173 +    0x000494ff, 0x31400000, 0x00049cff, 0x31610000,
  1.2174 +    0x0004a4ff, 0x31810000, 0x0004acff, 0x31a10000,
  1.2175 +    0x0004b4ff, 0x31c20000, 0x0004bdff, 0x31e20000,
  1.2176 +    0x0004c5ff, 0x39000000, 0x0004cdff, 0x39200000,
  1.2177 +    0x0004d5ff, 0x39400000, 0x0004deff, 0x39610000,
  1.2178 +    0x0004e6ff, 0x39810000, 0x0004eeff, 0x39a10000,
  1.2179 +    0x0004f6ff, 0x39c20000, 0x0004ffff, 0x39e20000,
  1.2180 +    0x000800ff, 0x41000000, 0x000808ff, 0x41200000,
  1.2181 +    0x000810ff, 0x41400000, 0x000818ff, 0x41610000,
  1.2182 +    0x000820ff, 0x41810000, 0x000829ff, 0x41a10000,
  1.2183 +    0x000831ff, 0x41c20000, 0x000839ff, 0x41e20000,
  1.2184 +    0x000841ff, 0x4a000000, 0x00084aff, 0x4a200000,
  1.2185 +    0x000852ff, 0x4a400000, 0x00085aff, 0x4a610000,
  1.2186 +    0x000862ff, 0x4a810000, 0x00086aff, 0x4aa10000,
  1.2187 +    0x000873ff, 0x4ac20000, 0x00087bff, 0x4ae20000,
  1.2188 +    0x000883ff, 0x52000000, 0x00088bff, 0x52200000,
  1.2189 +    0x000894ff, 0x52400000, 0x00089cff, 0x52610000,
  1.2190 +    0x0008a4ff, 0x52810000, 0x0008acff, 0x52a10000,
  1.2191 +    0x0008b4ff, 0x52c20000, 0x0008bdff, 0x52e20000,
  1.2192 +    0x0008c5ff, 0x5a000000, 0x0008cdff, 0x5a200000,
  1.2193 +    0x0008d5ff, 0x5a400000, 0x0008deff, 0x5a610000,
  1.2194 +    0x0008e6ff, 0x5a810000, 0x0008eeff, 0x5aa10000,
  1.2195 +    0x0008f6ff, 0x5ac20000, 0x0008ffff, 0x5ae20000,
  1.2196 +    0x000c00ff, 0x62000000, 0x000c08ff, 0x62200000,
  1.2197 +    0x000c10ff, 0x62400000, 0x000c18ff, 0x62610000,
  1.2198 +    0x000c20ff, 0x62810000, 0x000c29ff, 0x62a10000,
  1.2199 +    0x000c31ff, 0x62c20000, 0x000c39ff, 0x62e20000,
  1.2200 +    0x000c41ff, 0x6a000000, 0x000c4aff, 0x6a200000,
  1.2201 +    0x000c52ff, 0x6a400000, 0x000c5aff, 0x6a610000,
  1.2202 +    0x000c62ff, 0x6a810000, 0x000c6aff, 0x6aa10000,
  1.2203 +    0x000c73ff, 0x6ac20000, 0x000c7bff, 0x6ae20000,
  1.2204 +    0x000c83ff, 0x73000000, 0x000c8bff, 0x73200000,
  1.2205 +    0x000c94ff, 0x73400000, 0x000c9cff, 0x73610000,
  1.2206 +    0x000ca4ff, 0x73810000, 0x000cacff, 0x73a10000,
  1.2207 +    0x000cb4ff, 0x73c20000, 0x000cbdff, 0x73e20000,
  1.2208 +    0x000cc5ff, 0x7b000000, 0x000ccdff, 0x7b200000,
  1.2209 +    0x000cd5ff, 0x7b400000, 0x000cdeff, 0x7b610000,
  1.2210 +    0x000ce6ff, 0x7b810000, 0x000ceeff, 0x7ba10000,
  1.2211 +    0x000cf6ff, 0x7bc20000, 0x000cffff, 0x7be20000,
  1.2212 +    0x001000ff, 0x83000000, 0x001008ff, 0x83200000,
  1.2213 +    0x001010ff, 0x83400000, 0x001018ff, 0x83610000,
  1.2214 +    0x001020ff, 0x83810000, 0x001029ff, 0x83a10000,
  1.2215 +    0x001031ff, 0x83c20000, 0x001039ff, 0x83e20000,
  1.2216 +    0x001041ff, 0x8b000000, 0x00104aff, 0x8b200000,
  1.2217 +    0x001052ff, 0x8b400000, 0x00105aff, 0x8b610000,
  1.2218 +    0x001062ff, 0x8b810000, 0x00106aff, 0x8ba10000,
  1.2219 +    0x001073ff, 0x8bc20000, 0x00107bff, 0x8be20000,
  1.2220 +    0x001083ff, 0x94000000, 0x00108bff, 0x94200000,
  1.2221 +    0x001094ff, 0x94400000, 0x00109cff, 0x94610000,
  1.2222 +    0x0010a4ff, 0x94810000, 0x0010acff, 0x94a10000,
  1.2223 +    0x0010b4ff, 0x94c20000, 0x0010bdff, 0x94e20000,
  1.2224 +    0x0010c5ff, 0x9c000000, 0x0010cdff, 0x9c200000,
  1.2225 +    0x0010d5ff, 0x9c400000, 0x0010deff, 0x9c610000,
  1.2226 +    0x0010e6ff, 0x9c810000, 0x0010eeff, 0x9ca10000,
  1.2227 +    0x0010f6ff, 0x9cc20000, 0x0010ffff, 0x9ce20000,
  1.2228 +    0x001400ff, 0xa4000000, 0x001408ff, 0xa4200000,
  1.2229 +    0x001410ff, 0xa4400000, 0x001418ff, 0xa4610000,
  1.2230 +    0x001420ff, 0xa4810000, 0x001429ff, 0xa4a10000,
  1.2231 +    0x001431ff, 0xa4c20000, 0x001439ff, 0xa4e20000,
  1.2232 +    0x001441ff, 0xac000000, 0x00144aff, 0xac200000,
  1.2233 +    0x001452ff, 0xac400000, 0x00145aff, 0xac610000,
  1.2234 +    0x001462ff, 0xac810000, 0x00146aff, 0xaca10000,
  1.2235 +    0x001473ff, 0xacc20000, 0x00147bff, 0xace20000,
  1.2236 +    0x001483ff, 0xb4000000, 0x00148bff, 0xb4200000,
  1.2237 +    0x001494ff, 0xb4400000, 0x00149cff, 0xb4610000,
  1.2238 +    0x0014a4ff, 0xb4810000, 0x0014acff, 0xb4a10000,
  1.2239 +    0x0014b4ff, 0xb4c20000, 0x0014bdff, 0xb4e20000,
  1.2240 +    0x0014c5ff, 0xbd000000, 0x0014cdff, 0xbd200000,
  1.2241 +    0x0014d5ff, 0xbd400000, 0x0014deff, 0xbd610000,
  1.2242 +    0x0014e6ff, 0xbd810000, 0x0014eeff, 0xbda10000,
  1.2243 +    0x0014f6ff, 0xbdc20000, 0x0014ffff, 0xbde20000,
  1.2244 +    0x001800ff, 0xc5000000, 0x001808ff, 0xc5200000,
  1.2245 +    0x001810ff, 0xc5400000, 0x001818ff, 0xc5610000,
  1.2246 +    0x001820ff, 0xc5810000, 0x001829ff, 0xc5a10000,
  1.2247 +    0x001831ff, 0xc5c20000, 0x001839ff, 0xc5e20000,
  1.2248 +    0x001841ff, 0xcd000000, 0x00184aff, 0xcd200000,
  1.2249 +    0x001852ff, 0xcd400000, 0x00185aff, 0xcd610000,
  1.2250 +    0x001862ff, 0xcd810000, 0x00186aff, 0xcda10000,
  1.2251 +    0x001873ff, 0xcdc20000, 0x00187bff, 0xcde20000,
  1.2252 +    0x001883ff, 0xd5000000, 0x00188bff, 0xd5200000,
  1.2253 +    0x001894ff, 0xd5400000, 0x00189cff, 0xd5610000,
  1.2254 +    0x0018a4ff, 0xd5810000, 0x0018acff, 0xd5a10000,
  1.2255 +    0x0018b4ff, 0xd5c20000, 0x0018bdff, 0xd5e20000,
  1.2256 +    0x0018c5ff, 0xde000000, 0x0018cdff, 0xde200000,
  1.2257 +    0x0018d5ff, 0xde400000, 0x0018deff, 0xde610000,
  1.2258 +    0x0018e6ff, 0xde810000, 0x0018eeff, 0xdea10000,
  1.2259 +    0x0018f6ff, 0xdec20000, 0x0018ffff, 0xdee20000,
  1.2260 +    0x001c00ff, 0xe6000000, 0x001c08ff, 0xe6200000,
  1.2261 +    0x001c10ff, 0xe6400000, 0x001c18ff, 0xe6610000,
  1.2262 +    0x001c20ff, 0xe6810000, 0x001c29ff, 0xe6a10000,
  1.2263 +    0x001c31ff, 0xe6c20000, 0x001c39ff, 0xe6e20000,
  1.2264 +    0x001c41ff, 0xee000000, 0x001c4aff, 0xee200000,
  1.2265 +    0x001c52ff, 0xee400000, 0x001c5aff, 0xee610000,
  1.2266 +    0x001c62ff, 0xee810000, 0x001c6aff, 0xeea10000,
  1.2267 +    0x001c73ff, 0xeec20000, 0x001c7bff, 0xeee20000,
  1.2268 +    0x001c83ff, 0xf6000000, 0x001c8bff, 0xf6200000,
  1.2269 +    0x001c94ff, 0xf6400000, 0x001c9cff, 0xf6610000,
  1.2270 +    0x001ca4ff, 0xf6810000, 0x001cacff, 0xf6a10000,
  1.2271 +    0x001cb4ff, 0xf6c20000, 0x001cbdff, 0xf6e20000,
  1.2272 +    0x001cc5ff, 0xff000000, 0x001ccdff, 0xff200000,
  1.2273 +    0x001cd5ff, 0xff400000, 0x001cdeff, 0xff610000,
  1.2274 +    0x001ce6ff, 0xff810000, 0x001ceeff, 0xffa10000,
  1.2275 +    0x001cf6ff, 0xffc20000, 0x001cffff, 0xffe20000,
  1.2276  };
  1.2277 -static void Blit_RGB565_RGBA8888(SDL_BlitInfo *info)
  1.2278 +static void
  1.2279 +Blit_RGB565_RGBA8888(SDL_BlitInfo * info)
  1.2280  {
  1.2281      Blit_RGB565_32(info, RGB565_RGBA8888_LUT);
  1.2282  }
  1.2283  
  1.2284  /* Special optimized blit for RGB 5-6-5 --> BGRA 8-8-8-8 */
  1.2285  static const Uint32 RGB565_BGRA8888_LUT[512] = {
  1.2286 -		0x00000000, 0x000000ff, 0x08000000, 0x002000ff,
  1.2287 -		0x10000000, 0x004000ff, 0x18000000, 0x006100ff,
  1.2288 -		0x20000000, 0x008100ff, 0x29000000, 0x00a100ff,
  1.2289 -		0x31000000, 0x00c200ff, 0x39000000, 0x00e200ff,
  1.2290 -		0x41000000, 0x000008ff, 0x4a000000, 0x002008ff,
  1.2291 -		0x52000000, 0x004008ff, 0x5a000000, 0x006108ff,
  1.2292 -		0x62000000, 0x008108ff, 0x6a000000, 0x00a108ff,
  1.2293 -		0x73000000, 0x00c208ff, 0x7b000000, 0x00e208ff,
  1.2294 -		0x83000000, 0x000010ff, 0x8b000000, 0x002010ff,
  1.2295 -		0x94000000, 0x004010ff, 0x9c000000, 0x006110ff,
  1.2296 -		0xa4000000, 0x008110ff, 0xac000000, 0x00a110ff,
  1.2297 -		0xb4000000, 0x00c210ff, 0xbd000000, 0x00e210ff,
  1.2298 -		0xc5000000, 0x000018ff, 0xcd000000, 0x002018ff,
  1.2299 -		0xd5000000, 0x004018ff, 0xde000000, 0x006118ff,
  1.2300 -		0xe6000000, 0x008118ff, 0xee000000, 0x00a118ff,
  1.2301 -		0xf6000000, 0x00c218ff, 0xff000000, 0x00e218ff,
  1.2302 -		0x00040000, 0x000020ff, 0x08040000, 0x002020ff,
  1.2303 -		0x10040000, 0x004020ff, 0x18040000, 0x006120ff,
  1.2304 -		0x20040000, 0x008120ff, 0x29040000, 0x00a120ff,
  1.2305 -		0x31040000, 0x00c220ff, 0x39040000, 0x00e220ff,
  1.2306 -		0x41040000, 0x000029ff, 0x4a040000, 0x002029ff,
  1.2307 -		0x52040000, 0x004029ff, 0x5a040000, 0x006129ff,
  1.2308 -		0x62040000, 0x008129ff, 0x6a040000, 0x00a129ff,
  1.2309 -		0x73040000, 0x00c229ff, 0x7b040000, 0x00e229ff,
  1.2310 -		0x83040000, 0x000031ff, 0x8b040000, 0x002031ff,
  1.2311 -		0x94040000, 0x004031ff, 0x9c040000, 0x006131ff,
  1.2312 -		0xa4040000, 0x008131ff, 0xac040000, 0x00a131ff,
  1.2313 -		0xb4040000, 0x00c231ff, 0xbd040000, 0x00e231ff,
  1.2314 -		0xc5040000, 0x000039ff, 0xcd040000, 0x002039ff,
  1.2315 -		0xd5040000, 0x004039ff, 0xde040000, 0x006139ff,
  1.2316 -		0xe6040000, 0x008139ff, 0xee040000, 0x00a139ff,
  1.2317 -		0xf6040000, 0x00c239ff, 0xff040000, 0x00e239ff,
  1.2318 -		0x00080000, 0x000041ff, 0x08080000, 0x002041ff,
  1.2319 -		0x10080000, 0x004041ff, 0x18080000, 0x006141ff,
  1.2320 -		0x20080000, 0x008141ff, 0x29080000, 0x00a141ff,
  1.2321 -		0x31080000, 0x00c241ff, 0x39080000, 0x00e241ff,
  1.2322 -		0x41080000, 0x00004aff, 0x4a080000, 0x00204aff,
  1.2323 -		0x52080000, 0x00404aff, 0x5a080000, 0x00614aff,
  1.2324 -		0x62080000, 0x00814aff, 0x6a080000, 0x00a14aff,
  1.2325 -		0x73080000, 0x00c24aff, 0x7b080000, 0x00e24aff,
  1.2326 -		0x83080000, 0x000052ff, 0x8b080000, 0x002052ff,
  1.2327 -		0x94080000, 0x004052ff, 0x9c080000, 0x006152ff,
  1.2328 -		0xa4080000, 0x008152ff, 0xac080000, 0x00a152ff,
  1.2329 -		0xb4080000, 0x00c252ff, 0xbd080000, 0x00e252ff,
  1.2330 -		0xc5080000, 0x00005aff, 0xcd080000, 0x00205aff,
  1.2331 -		0xd5080000, 0x00405aff, 0xde080000, 0x00615aff,
  1.2332 -		0xe6080000, 0x00815aff, 0xee080000, 0x00a15aff,
  1.2333 -		0xf6080000, 0x00c25aff, 0xff080000, 0x00e25aff,
  1.2334 -		0x000c0000, 0x000062ff, 0x080c0000, 0x002062ff,
  1.2335 -		0x100c0000, 0x004062ff, 0x180c0000, 0x006162ff,
  1.2336 -		0x200c0000, 0x008162ff, 0x290c0000, 0x00a162ff,
  1.2337 -		0x310c0000, 0x00c262ff, 0x390c0000, 0x00e262ff,
  1.2338 -		0x410c0000, 0x00006aff, 0x4a0c0000, 0x00206aff,
  1.2339 -		0x520c0000, 0x00406aff, 0x5a0c0000, 0x00616aff,
  1.2340 -		0x620c0000, 0x00816aff, 0x6a0c0000, 0x00a16aff,
  1.2341 -		0x730c0000, 0x00c26aff, 0x7b0c0000, 0x00e26aff,
  1.2342 -		0x830c0000, 0x000073ff, 0x8b0c0000, 0x002073ff,
  1.2343 -		0x940c0000, 0x004073ff, 0x9c0c0000, 0x006173ff,
  1.2344 -		0xa40c0000, 0x008173ff, 0xac0c0000, 0x00a173ff,
  1.2345 -		0xb40c0000, 0x00c273ff, 0xbd0c0000, 0x00e273ff,
  1.2346 -		0xc50c0000, 0x00007bff, 0xcd0c0000, 0x00207bff,
  1.2347 -		0xd50c0000, 0x00407bff, 0xde0c0000, 0x00617bff,
  1.2348 -		0xe60c0000, 0x00817bff, 0xee0c0000, 0x00a17bff,
  1.2349 -		0xf60c0000, 0x00c27bff, 0xff0c0000, 0x00e27bff,
  1.2350 -		0x00100000, 0x000083ff, 0x08100000, 0x002083ff,
  1.2351 -		0x10100000, 0x004083ff, 0x18100000, 0x006183ff,
  1.2352 -		0x20100000, 0x008183ff, 0x29100000, 0x00a183ff,
  1.2353 -		0x31100000, 0x00c283ff, 0x39100000, 0x00e283ff,
  1.2354 -		0x41100000, 0x00008bff, 0x4a100000, 0x00208bff,
  1.2355 -		0x52100000, 0x00408bff, 0x5a100000, 0x00618bff,
  1.2356 -		0x62100000, 0x00818bff, 0x6a100000, 0x00a18bff,
  1.2357 -		0x73100000, 0x00c28bff, 0x7b100000, 0x00e28bff,
  1.2358 -		0x83100000, 0x000094ff, 0x8b100000, 0x002094ff,
  1.2359 -		0x94100000, 0x004094ff, 0x9c100000, 0x006194ff,
  1.2360 -		0xa4100000, 0x008194ff, 0xac100000, 0x00a194ff,
  1.2361 -		0xb4100000, 0x00c294ff, 0xbd100000, 0x00e294ff,
  1.2362 -		0xc5100000, 0x00009cff, 0xcd100000, 0x00209cff,
  1.2363 -		0xd5100000, 0x00409cff, 0xde100000, 0x00619cff,
  1.2364 -		0xe6100000, 0x00819cff, 0xee100000, 0x00a19cff,
  1.2365 -		0xf6100000, 0x00c29cff, 0xff100000, 0x00e29cff,
  1.2366 -		0x00140000, 0x0000a4ff, 0x08140000, 0x0020a4ff,
  1.2367 -		0x10140000, 0x0040a4ff, 0x18140000, 0x0061a4ff,
  1.2368 -		0x20140000, 0x0081a4ff, 0x29140000, 0x00a1a4ff,
  1.2369 -		0x31140000, 0x00c2a4ff, 0x39140000, 0x00e2a4ff,
  1.2370 -		0x41140000, 0x0000acff, 0x4a140000, 0x0020acff,
  1.2371 -		0x52140000, 0x0040acff, 0x5a140000, 0x0061acff,
  1.2372 -		0x62140000, 0x0081acff, 0x6a140000, 0x00a1acff,
  1.2373 -		0x73140000, 0x00c2acff, 0x7b140000, 0x00e2acff,
  1.2374 -		0x83140000, 0x0000b4ff, 0x8b140000, 0x0020b4ff,
  1.2375 -		0x94140000, 0x0040b4ff, 0x9c140000, 0x0061b4ff,
  1.2376 -		0xa4140000, 0x0081b4ff, 0xac140000, 0x00a1b4ff,
  1.2377 -		0xb4140000, 0x00c2b4ff, 0xbd140000, 0x00e2b4ff,
  1.2378 -		0xc5140000, 0x0000bdff, 0xcd140000, 0x0020bdff,
  1.2379 -		0xd5140000, 0x0040bdff, 0xde140000, 0x0061bdff,
  1.2380 -		0xe6140000, 0x0081bdff, 0xee140000, 0x00a1bdff,
  1.2381 -		0xf6140000, 0x00c2bdff, 0xff140000, 0x00e2bdff,
  1.2382 -		0x00180000, 0x0000c5ff, 0x08180000, 0x0020c5ff,
  1.2383 -		0x10180000, 0x0040c5ff, 0x18180000, 0x0061c5ff,
  1.2384 -		0x20180000, 0x0081c5ff, 0x29180000, 0x00a1c5ff,
  1.2385 -		0x31180000, 0x00c2c5ff, 0x39180000, 0x00e2c5ff,
  1.2386 -		0x41180000, 0x0000cdff, 0x4a180000, 0x0020cdff,
  1.2387 -		0x52180000, 0x0040cdff, 0x5a180000, 0x0061cdff,
  1.2388 -		0x62180000, 0x0081cdff, 0x6a180000, 0x00a1cdff,
  1.2389 -		0x73180000, 0x00c2cdff, 0x7b180000, 0x00e2cdff,
  1.2390 -		0x83180000, 0x0000d5ff, 0x8b180000, 0x0020d5ff,
  1.2391 -		0x94180000, 0x0040d5ff, 0x9c180000, 0x0061d5ff,
  1.2392 -		0xa4180000, 0x0081d5ff, 0xac180000, 0x00a1d5ff,
  1.2393 -		0xb4180000, 0x00c2d5ff, 0xbd180000, 0x00e2d5ff,
  1.2394 -		0xc5180000, 0x0000deff, 0xcd180000, 0x0020deff,
  1.2395 -		0xd5180000, 0x0040deff, 0xde180000, 0x0061deff,
  1.2396 -		0xe6180000, 0x0081deff, 0xee180000, 0x00a1deff,
  1.2397 -		0xf6180000, 0x00c2deff, 0xff180000, 0x00e2deff,
  1.2398 -		0x001c0000, 0x0000e6ff, 0x081c0000, 0x0020e6ff,
  1.2399 -		0x101c0000, 0x0040e6ff, 0x181c0000, 0x0061e6ff,
  1.2400 -		0x201c0000, 0x0081e6ff, 0x291c0000, 0x00a1e6ff,
  1.2401 -		0x311c0000, 0x00c2e6ff, 0x391c0000, 0x00e2e6ff,
  1.2402 -		0x411c0000, 0x0000eeff, 0x4a1c0000, 0x0020eeff,
  1.2403 -		0x521c0000, 0x0040eeff, 0x5a1c0000, 0x0061eeff,
  1.2404 -		0x621c0000, 0x0081eeff, 0x6a1c0000, 0x00a1eeff,
  1.2405 -		0x731c0000, 0x00c2eeff, 0x7b1c0000, 0x00e2eeff,
  1.2406 -		0x831c0000, 0x0000f6ff, 0x8b1c0000, 0x0020f6ff,
  1.2407 -		0x941c0000, 0x0040f6ff, 0x9c1c0000, 0x0061f6ff,
  1.2408 -		0xa41c0000, 0x0081f6ff, 0xac1c0000, 0x00a1f6ff,
  1.2409 -		0xb41c0000, 0x00c2f6ff, 0xbd1c0000, 0x00e2f6ff,
  1.2410 -		0xc51c0000, 0x0000ffff, 0xcd1c0000, 0x0020ffff,
  1.2411 -		0xd51c0000, 0x0040ffff, 0xde1c0000, 0x0061ffff,
  1.2412 -		0xe61c0000, 0x0081ffff, 0xee1c0000, 0x00a1ffff,
  1.2413 -		0xf61c0000, 0x00c2ffff, 0xff1c0000, 0x00e2ffff
  1.2414 +    0x00000000, 0x000000ff, 0x08000000, 0x002000ff,
  1.2415 +    0x10000000, 0x004000ff, 0x18000000, 0x006100ff,
  1.2416 +    0x20000000, 0x008100ff, 0x29000000, 0x00a100ff,
  1.2417 +    0x31000000, 0x00c200ff, 0x39000000, 0x00e200ff,
  1.2418 +    0x41000000, 0x000008ff, 0x4a000000, 0x002008ff,
  1.2419 +    0x52000000, 0x004008ff, 0x5a000000, 0x006108ff,
  1.2420 +    0x62000000, 0x008108ff, 0x6a000000, 0x00a108ff,
  1.2421 +    0x73000000, 0x00c208ff, 0x7b000000, 0x00e208ff,
  1.2422 +    0x83000000, 0x000010ff, 0x8b000000, 0x002010ff,
  1.2423 +    0x94000000, 0x004010ff, 0x9c000000, 0x006110ff,
  1.2424 +    0xa4000000, 0x008110ff, 0xac000000, 0x00a110ff,
  1.2425 +    0xb4000000, 0x00c210ff, 0xbd000000, 0x00e210ff,
  1.2426 +    0xc5000000, 0x000018ff, 0xcd000000, 0x002018ff,
  1.2427 +    0xd5000000, 0x004018ff, 0xde000000, 0x006118ff,
  1.2428 +    0xe6000000, 0x008118ff, 0xee000000, 0x00a118ff,
  1.2429 +    0xf6000000, 0x00c218ff, 0xff000000, 0x00e218ff,
  1.2430 +    0x00040000, 0x000020ff, 0x08040000, 0x002020ff,
  1.2431 +    0x10040000, 0x004020ff, 0x18040000, 0x006120ff,
  1.2432 +    0x20040000, 0x008120ff, 0x29040000, 0x00a120ff,
  1.2433 +    0x31040000, 0x00c220ff, 0x39040000, 0x00e220ff,
  1.2434 +    0x41040000, 0x000029ff, 0x4a040000, 0x002029ff,
  1.2435 +    0x52040000, 0x004029ff, 0x5a040000, 0x006129ff,
  1.2436 +    0x62040000, 0x008129ff, 0x6a040000, 0x00a129ff,
  1.2437 +    0x73040000, 0x00c229ff, 0x7b040000, 0x00e229ff,
  1.2438 +    0x83040000, 0x000031ff, 0x8b040000, 0x002031ff,
  1.2439 +    0x94040000, 0x004031ff, 0x9c040000, 0x006131ff,
  1.2440 +    0xa4040000, 0x008131ff, 0xac040000, 0x00a131ff,
  1.2441 +    0xb4040000, 0x00c231ff, 0xbd040000, 0x00e231ff,
  1.2442 +    0xc5040000, 0x000039ff, 0xcd040000, 0x002039ff,
  1.2443 +    0xd5040000, 0x004039ff, 0xde040000, 0x006139ff,
  1.2444 +    0xe6040000, 0x008139ff, 0xee040000, 0x00a139ff,
  1.2445 +    0xf6040000, 0x00c239ff, 0xff040000, 0x00e239ff,
  1.2446 +    0x00080000, 0x000041ff, 0x08080000, 0x002041ff,
  1.2447 +    0x10080000, 0x004041ff, 0x18080000, 0x006141ff,
  1.2448 +    0x20080000, 0x008141ff, 0x29080000, 0x00a141ff,
  1.2449 +    0x31080000, 0x00c241ff, 0x39080000, 0x00e241ff,
  1.2450 +    0x41080000, 0x00004aff, 0x4a080000, 0x00204aff,
  1.2451 +    0x52080000, 0x00404aff, 0x5a080000, 0x00614aff,
  1.2452 +    0x62080000, 0x00814aff, 0x6a080000, 0x00a14aff,
  1.2453 +    0x73080000, 0x00c24aff, 0x7b080000, 0x00e24aff,
  1.2454 +    0x83080000, 0x000052ff, 0x8b080000, 0x002052ff,
  1.2455 +    0x94080000, 0x004052ff, 0x9c080000, 0x006152ff,
  1.2456 +    0xa4080000, 0x008152ff, 0xac080000, 0x00a152ff,
  1.2457 +    0xb4080000, 0x00c252ff, 0xbd080000, 0x00e252ff,
  1.2458 +    0xc5080000, 0x00005aff, 0xcd080000, 0x00205aff,
  1.2459 +    0xd5080000, 0x00405aff, 0xde080000, 0x00615aff,
  1.2460 +    0xe6080000, 0x00815aff, 0xee080000, 0x00a15aff,
  1.2461 +    0xf6080000, 0x00c25aff, 0xff080000, 0x00e25aff,
  1.2462 +    0x000c0000, 0x000062ff, 0x080c0000, 0x002062ff,
  1.2463 +    0x100c0000, 0x004062ff, 0x180c0000, 0x006162ff,
  1.2464 +    0x200c0000, 0x008162ff, 0x290c0000, 0x00a162ff,
  1.2465 +    0x310c0000, 0x00c262ff, 0x390c0000, 0x00e262ff,
  1.2466 +    0x410c0000, 0x00006aff, 0x4a0c0000, 0x00206aff,
  1.2467 +    0x520c0000, 0x00406aff, 0x5a0c0000, 0x00616aff,
  1.2468 +    0x620c0000, 0x00816aff, 0x6a0c0000, 0x00a16aff,
  1.2469 +    0x730c0000, 0x00c26aff, 0x7b0c0000, 0x00e26aff,
  1.2470 +    0x830c0000, 0x000073ff, 0x8b0c0000, 0x002073ff,
  1.2471 +    0x940c0000, 0x004073ff, 0x9c0c0000, 0x006173ff,
  1.2472 +    0xa40c0000, 0x008173ff, 0xac0c0000, 0x00a173ff,
  1.2473 +    0xb40c0000, 0x00c273ff, 0xbd0c0000, 0x00e273ff,
  1.2474 +    0xc50c0000, 0x00007bff, 0xcd0c0000, 0x00207bff,
  1.2475 +    0xd50c0000, 0x00407bff, 0xde0c0000, 0x00617bff,
  1.2476 +    0xe60c0000, 0x00817bff, 0xee0c0000, 0x00a17bff,
  1.2477 +    0xf60c0000, 0x00c27bff, 0xff0c0000, 0x00e27bff,
  1.2478 +    0x00100000, 0x000083ff, 0x08100000, 0x002083ff,
  1.2479 +    0x10100000, 0x004083ff, 0x18100000, 0x006183ff,
  1.2480 +    0x20100000, 0x008183ff, 0x29100000, 0x00a183ff,
  1.2481 +    0x31100000, 0x00c283ff, 0x39100000, 0x00e283ff,
  1.2482 +    0x41100000, 0x00008bff, 0x4a100000, 0x00208bff,
  1.2483 +    0x52100000, 0x00408bff, 0x5a100000, 0x00618bff,
  1.2484 +    0x62100000, 0x00818bff, 0x6a100000, 0x00a18bff,
  1.2485 +    0x73100000, 0x00c28bff, 0x7b100000, 0x00e28bff,
  1.2486 +    0x83100000, 0x000094ff, 0x8b100000, 0x002094ff,
  1.2487 +    0x94100000, 0x004094ff, 0x9c100000, 0x006194ff,
  1.2488 +    0xa4100000, 0x008194ff, 0xac100000, 0x00a194ff,
  1.2489 +    0xb4100000, 0x00c294ff, 0xbd100000, 0x00e294ff,
  1.2490 +    0xc5100000, 0x00009cff, 0xcd100000, 0x00209cff,
  1.2491 +    0xd5100000, 0x00409cff, 0xde100000, 0x00619cff,
  1.2492 +    0xe6100000, 0x00819cff, 0xee100000, 0x00a19cff,
  1.2493 +    0xf6100000, 0x00c29cff, 0xff100000, 0x00e29cff,
  1.2494 +    0x00140000, 0x0000a4ff, 0x08140000, 0x0020a4ff,
  1.2495 +    0x10140000, 0x0040a4ff, 0x18140000, 0x0061a4ff,
  1.2496 +    0x20140000, 0x0081a4ff, 0x29140000, 0x00a1a4ff,
  1.2497 +    0x31140000, 0x00c2a4ff, 0x39140000, 0x00e2a4ff,
  1.2498 +    0x41140000, 0x0000acff, 0x4a140000, 0x0020acff,
  1.2499 +    0x52140000, 0x0040acff, 0x5a140000, 0x0061acff,
  1.2500 +    0x62140000, 0x0081acff, 0x6a140000, 0x00a1acff,
  1.2501 +    0x73140000, 0x00c2acff, 0x7b140000, 0x00e2acff,
  1.2502 +    0x83140000, 0x0000b4ff, 0x8b140000, 0x0020b4ff,
  1.2503 +    0x94140000, 0x0040b4ff, 0x9c140000, 0x0061b4ff,
  1.2504 +    0xa4140000, 0x0081b4ff, 0xac140000, 0x00a1b4ff,
  1.2505 +    0xb4140000, 0x00c2b4ff, 0xbd140000, 0x00e2b4ff,
  1.2506 +    0xc5140000, 0x0000bdff, 0xcd140000, 0x0020bdff,
  1.2507 +    0xd5140000, 0x0040bdff, 0xde140000, 0x0061bdff,
  1.2508 +    0xe6140000, 0x0081bdff, 0xee140000, 0x00a1bdff,
  1.2509 +    0xf6140000, 0x00c2bdff, 0xff140000, 0x00e2bdff,
  1.2510 +    0x00180000, 0x0000c5ff, 0x08180000, 0x0020c5ff,
  1.2511 +    0x10180000, 0x0040c5ff, 0x18180000, 0x0061c5ff,
  1.2512 +    0x20180000, 0x0081c5ff, 0x29180000, 0x00a1c5ff,
  1.2513 +    0x31180000, 0x00c2c5ff, 0x39180000, 0x00e2c5ff,
  1.2514 +    0x41180000, 0x0000cdff, 0x4a180000, 0x0020cdff,
  1.2515 +    0x52180000, 0x0040cdff, 0x5a180000, 0x0061cdff,
  1.2516 +    0x62180000, 0x0081cdff, 0x6a180000, 0x00a1cdff,
  1.2517 +    0x73180000, 0x00c2cdff, 0x7b180000, 0x00e2cdff,
  1.2518 +    0x83180000, 0x0000d5ff, 0x8b180000, 0x0020d5ff,
  1.2519 +    0x94180000, 0x0040d5ff, 0x9c180000, 0x0061d5ff,
  1.2520 +    0xa4180000, 0x0081d5ff, 0xac180000, 0x00a1d5ff,
  1.2521 +    0xb4180000, 0x00c2d5ff, 0xbd180000, 0x00e2d5ff,
  1.2522 +    0xc5180000, 0x0000deff, 0xcd180000, 0x0020deff,
  1.2523 +    0xd5180000, 0x0040deff, 0xde180000, 0x0061deff,
  1.2524 +    0xe6180000, 0x0081deff, 0xee180000, 0x00a1deff,
  1.2525 +    0xf6180000, 0x00c2deff, 0xff180000, 0x00e2deff,
  1.2526 +    0x001c0000, 0x0000e6ff, 0x081c0000, 0x0020e6ff,
  1.2527 +    0x101c0000, 0x0040e6ff, 0x181c0000, 0x0061e6ff,
  1.2528 +    0x201c0000, 0x0081e6ff, 0x291c0000, 0x00a1e6ff,
  1.2529 +    0x311c0000, 0x00c2e6ff, 0x391c0000, 0x00e2e6ff,
  1.2530 +    0x411c0000, 0x0000eeff, 0x4a1c0000, 0x0020eeff,
  1.2531 +    0x521c0000, 0x0040eeff, 0x5a1c0000, 0x0061eeff,
  1.2532 +    0x621c0000, 0x0081eeff, 0x6a1c0000, 0x00a1eeff,
  1.2533 +    0x731c0000, 0x00c2eeff, 0x7b1c0000, 0x00e2eeff,
  1.2534 +    0x831c0000, 0x0000f6ff, 0x8b1c0000, 0x0020f6ff,
  1.2535 +    0x941c0000, 0x0040f6ff, 0x9c1c0000, 0x0061f6ff,
  1.2536 +    0xa41c0000, 0x0081f6ff, 0xac1c0000, 0x00a1f6ff,
  1.2537 +    0xb41c0000, 0x00c2f6ff, 0xbd1c0000, 0x00e2f6ff,
  1.2538 +    0xc51c0000, 0x0000ffff, 0xcd1c0000, 0x0020ffff,
  1.2539 +    0xd51c0000, 0x0040ffff, 0xde1c0000, 0x0061ffff,
  1.2540 +    0xe61c0000, 0x0081ffff, 0xee1c0000, 0x00a1ffff,
  1.2541 +    0xf61c0000, 0x00c2ffff, 0xff1c0000, 0x00e2ffff
  1.2542  };
  1.2543 -static void Blit_RGB565_BGRA8888(SDL_BlitInfo *info)
  1.2544 +static void
  1.2545 +Blit_RGB565_BGRA8888(SDL_BlitInfo * info)
  1.2546  {
  1.2547      Blit_RGB565_32(info, RGB565_BGRA8888_LUT);
  1.2548  }
  1.2549 @@ -1826,102 +1875,107 @@
  1.2550  	      (((src)&0x000000C0)>>6); \
  1.2551  }
  1.2552  #endif
  1.2553 -static void Blit_RGB888_index8_map(SDL_BlitInfo *info)
  1.2554 +static void
  1.2555 +Blit_RGB888_index8_map(SDL_BlitInfo * info)
  1.2556  {
  1.2557  #ifndef USE_DUFFS_LOOP
  1.2558 -	int c;
  1.2559 +    int c;
  1.2560  #endif
  1.2561 -	int Pixel;
  1.2562 -	int width, height;
  1.2563 -	Uint32 *src;
  1.2564 -	const Uint8 *map;
  1.2565 -	Uint8 *dst;
  1.2566 -	int srcskip, dstskip;
  1.2567 +    int Pixel;
  1.2568 +    int width, height;
  1.2569 +    Uint32 *src;
  1.2570 +    const Uint8 *map;
  1.2571 +    Uint8 *dst;
  1.2572 +    int srcskip, dstskip;
  1.2573  
  1.2574 -	/* Set up some basic variables */
  1.2575 -	width = info->d_width;
  1.2576 -	height = info->d_height;
  1.2577 -	src = (Uint32 *)info->s_pixels;
  1.2578 -	srcskip = info->s_skip/4;
  1.2579 -	dst = info->d_pixels;
  1.2580 -	dstskip = info->d_skip;
  1.2581 -	map = info->table;
  1.2582 +    /* Set up some basic variables */
  1.2583 +    width = info->d_width;
  1.2584 +    height = info->d_height;
  1.2585 +    src = (Uint32 *) info->s_pixels;
  1.2586 +    srcskip = info->s_skip / 4;
  1.2587 +    dst = info->d_pixels;
  1.2588 +    dstskip = info->d_skip;
  1.2589 +    map = info->table;
  1.2590  
  1.2591  #ifdef USE_DUFFS_LOOP
  1.2592 -	while ( height-- ) {
  1.2593 +    while (height--) {
  1.2594 +		/* *INDENT-OFF* */
  1.2595  		DUFFS_LOOP(
  1.2596  			RGB888_RGB332(Pixel, *src);
  1.2597  			*dst++ = map[Pixel];
  1.2598  			++src;
  1.2599  		, width);
  1.2600 -		src += srcskip;
  1.2601 -		dst += dstskip;
  1.2602 -	}
  1.2603 +		/* *INDENT-ON* */
  1.2604 +        src += srcskip;
  1.2605 +        dst += dstskip;
  1.2606 +    }
  1.2607  #else
  1.2608 -	while ( height-- ) {
  1.2609 -		for ( c=width/4; c; --c ) {
  1.2610 -			/* Pack RGB into 8bit pixel */
  1.2611 -			RGB888_RGB332(Pixel, *src);
  1.2612 -			*dst++ = map[Pixel];
  1.2613 -			++src;
  1.2614 -			RGB888_RGB332(Pixel, *src);
  1.2615 -			*dst++ = map[Pixel];
  1.2616 -			++src;
  1.2617 -			RGB888_RGB332(Pixel, *src);
  1.2618 -			*dst++ = map[Pixel];
  1.2619 -			++src;
  1.2620 -			RGB888_RGB332(Pixel, *src);
  1.2621 -			*dst++ = map[Pixel];
  1.2622 -			++src;
  1.2623 -		}
  1.2624 -		switch ( width & 3 ) {
  1.2625 -			case 3:
  1.2626 -				RGB888_RGB332(Pixel, *src);
  1.2627 -				*dst++ = map[Pixel];
  1.2628 -				++src;
  1.2629 -			case 2:
  1.2630 -				RGB888_RGB332(Pixel, *src);
  1.2631 -				*dst++ = map[Pixel];
  1.2632 -				++src;
  1.2633 -			case 1:
  1.2634 -				RGB888_RGB332(Pixel, *src);
  1.2635 -				*dst++ = map[Pixel];
  1.2636 -				++src;
  1.2637 -		}
  1.2638 -		src += srcskip;
  1.2639 -		dst += dstskip;
  1.2640 -	}
  1.2641 +    while (height--) {
  1.2642 +        for (c = width / 4; c; --c) {
  1.2643 +            /* Pack RGB into 8bit pixel */
  1.2644 +            RGB888_RGB332(Pixel, *src);
  1.2645 +            *dst++ = map[Pixel];
  1.2646 +            ++src;
  1.2647 +            RGB888_RGB332(Pixel, *src);
  1.2648 +            *dst++ = map[Pixel];
  1.2649 +            ++src;
  1.2650 +            RGB888_RGB332(Pixel, *src);
  1.2651 +            *dst++ = map[Pixel];
  1.2652 +            ++src;
  1.2653 +            RGB888_RGB332(Pixel, *src);
  1.2654 +            *dst++ = map[Pixel];
  1.2655 +            ++src;
  1.2656 +        }
  1.2657 +        switch (width & 3) {
  1.2658 +        case 3:
  1.2659 +            RGB888_RGB332(Pixel, *src);
  1.2660 +            *dst++ = map[Pixel];
  1.2661 +            ++src;
  1.2662 +        case 2:
  1.2663 +            RGB888_RGB332(Pixel, *src);
  1.2664 +            *dst++ = map[Pixel];
  1.2665 +            ++src;
  1.2666 +        case 1:
  1.2667 +            RGB888_RGB332(Pixel, *src);
  1.2668 +            *dst++ = map[Pixel];
  1.2669 +            ++src;
  1.2670 +        }
  1.2671 +        src += srcskip;
  1.2672 +        dst += dstskip;
  1.2673 +    }
  1.2674  #endif /* USE_DUFFS_LOOP */
  1.2675  }
  1.2676 -static void BlitNto1(SDL_BlitInfo *info)
  1.2677 +static void
  1.2678 +BlitNto1(SDL_BlitInfo * info)
  1.2679  {
  1.2680  #ifndef USE_DUFFS_LOOP
  1.2681 -	int c;
  1.2682 +    int c;
  1.2683  #endif
  1.2684 -	int width, height;
  1.2685 -	Uint8 *src;
  1.2686 -	const Uint8 *map;
  1.2687 -	Uint8 *dst;
  1.2688 -	int srcskip, dstskip;
  1.2689 -	int srcbpp;
  1.2690 -	Uint32 Pixel;
  1.2691 -	int  sR, sG, sB;
  1.2692 -	SDL_PixelFormat *srcfmt;
  1.2693 +    int width, height;
  1.2694 +    Uint8 *src;
  1.2695 +    const Uint8 *map;
  1.2696 +    Uint8 *dst;
  1.2697 +    int srcskip, dstskip;
  1.2698 +    int srcbpp;
  1.2699 +    Uint32 Pixel;
  1.2700 +    int sR, sG, sB;
  1.2701 +    SDL_PixelFormat *srcfmt;
  1.2702  
  1.2703 -	/* Set up some basic variables */
  1.2704 -	width = info->d_width;
  1.2705 -	height = info->d_height;
  1.2706 -	src = info->s_pixels;
  1.2707 -	srcskip = info->s_skip;
  1.2708 -	dst = info->d_pixels;
  1.2709 -	dstskip = info->d_skip;
  1.2710 -	map = info->table;
  1.2711 -	srcfmt = info->src;
  1.2712 -	srcbpp = srcfmt->BytesPerPixel;
  1.2713 +    /* Set up some basic variables */
  1.2714 +    width = info->d_width;
  1.2715 +    height = info->d_height;
  1.2716 +    src = info->s_pixels;
  1.2717 +    srcskip = info->s_skip;
  1.2718 +    dst = info->d_pixels;
  1.2719 +    dstskip = info->d_skip;
  1.2720 +    map = info->table;
  1.2721 +    srcfmt = info->src;
  1.2722 +    srcbpp = srcfmt->BytesPerPixel;
  1.2723  
  1.2724 -	if ( map == NULL ) {
  1.2725 -		while ( height-- ) {
  1.2726 +    if (map == NULL) {
  1.2727 +        while (height--) {
  1.2728  #ifdef USE_DUFFS_LOOP
  1.2729 +			/* *INDENT-OFF* */
  1.2730  			DUFFS_LOOP(
  1.2731  				DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
  1.2732  								sR, sG, sB);
  1.2733 @@ -1934,26 +1988,26 @@
  1.2734  				dst++;
  1.2735  				src += srcbpp;
  1.2736  			, width);
  1.2737 +			/* *INDENT-ON* */
  1.2738  #else
  1.2739 -			for ( c=width; c; --c ) {
  1.2740 -				DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
  1.2741 -								sR, sG, sB);
  1.2742 -				if ( 1 ) {
  1.2743 -				  	/* Pack RGB into 8bit pixel */
  1.2744 -				  	*dst = ((sR>>5)<<(3+2))|
  1.2745 -					        ((sG>>5)<<(2)) |
  1.2746 -					        ((sB>>6)<<(0)) ;
  1.2747 -				}
  1.2748 -				dst++;
  1.2749 -				src += srcbpp;
  1.2750 -			}
  1.2751 +            for (c = width; c; --c) {
  1.2752 +                DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
  1.2753 +                if (1) {
  1.2754 +                    /* Pack RGB into 8bit pixel */
  1.2755 +                    *dst = ((sR >> 5) << (3 + 2)) |
  1.2756 +                        ((sG >> 5) << (2)) | ((sB >> 6) << (0));
  1.2757 +                }
  1.2758 +                dst++;
  1.2759 +                src += srcbpp;
  1.2760 +            }
  1.2761  #endif
  1.2762 -			src += srcskip;
  1.2763 -			dst += dstskip;
  1.2764 -		}
  1.2765 -	} else {
  1.2766 -		while ( height-- ) {
  1.2767 +            src += srcskip;
  1.2768 +            dst += dstskip;
  1.2769 +        }
  1.2770 +    } else {
  1.2771 +        while (height--) {
  1.2772  #ifdef USE_DUFFS_LOOP
  1.2773 +			/* *INDENT-OFF* */
  1.2774  			DUFFS_LOOP(
  1.2775  				DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
  1.2776  								sR, sG, sB);
  1.2777 @@ -1966,43 +2020,44 @@
  1.2778  				dst++;
  1.2779  				src += srcbpp;
  1.2780  			, width);
  1.2781 +			/* *INDENT-ON* */
  1.2782  #else
  1.2783 -			for ( c=width; c; --c ) {
  1.2784 -				DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
  1.2785 -								sR, sG, sB);
  1.2786 -				if ( 1 ) {
  1.2787 -				  	/* Pack RGB into 8bit pixel */
  1.2788 -				  	*dst = map[((sR>>5)<<(3+2))|
  1.2789 -						   ((sG>>5)<<(2))  |
  1.2790 -						   ((sB>>6)<<(0))  ];
  1.2791 -				}
  1.2792 -				dst++;
  1.2793 -				src += srcbpp;
  1.2794 -			}
  1.2795 +            for (c = width; c; --c) {
  1.2796 +                DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
  1.2797 +                if (1) {
  1.2798 +                    /* Pack RGB into 8bit pixel */
  1.2799 +                    *dst = map[((sR >> 5) << (3 + 2)) |
  1.2800 +                               ((sG >> 5) << (2)) | ((sB >> 6) << (0))];
  1.2801 +                }
  1.2802 +                dst++;
  1.2803 +                src += srcbpp;
  1.2804 +            }
  1.2805  #endif /* USE_DUFFS_LOOP */
  1.2806 -			src += srcskip;
  1.2807 -			dst += dstskip;
  1.2808 -		}
  1.2809 -	}
  1.2810 +            src += srcskip;
  1.2811 +            dst += dstskip;
  1.2812 +        }
  1.2813 +    }
  1.2814  }
  1.2815  
  1.2816  /* blits 32 bit RGB<->RGBA with both surfaces having the same R,G,B fields */
  1.2817 -static void Blit4to4MaskAlpha(SDL_BlitInfo *info)
  1.2818 +static void
  1.2819 +Blit4to4MaskAlpha(SDL_BlitInfo * info)
  1.2820  {
  1.2821 -	int width = info->d_width;
  1.2822 -	int height = info->d_height;
  1.2823 -	Uint32 *src = (Uint32 *)info->s_pixels;
  1.2824 -	int srcskip = info->s_skip;
  1.2825 -	Uint32 *dst = (Uint32 *)info->d_pixels;
  1.2826 -	int dstskip = info->d_skip;
  1.2827 -	SDL_PixelFormat *srcfmt = info->src;
  1.2828 -	SDL_PixelFormat *dstfmt = info->dst;
  1.2829 +    int width = info->d_width;
  1.2830 +    int height = info->d_height;
  1.2831 +    Uint32 *src = (Uint32 *) info->s_pixels;
  1.2832 +    int srcskip = info->s_skip;
  1.2833 +    Uint32 *dst = (Uint32 *) info->d_pixels;
  1.2834 +    int dstskip = info->d_skip;
  1.2835 +    SDL_PixelFormat *srcfmt = info->src;
  1.2836 +    SDL_PixelFormat *dstfmt = info->dst;
  1.2837  
  1.2838 -	if (dstfmt->Amask) {
  1.2839 -		/* RGB->RGBA, SET_ALPHA */
  1.2840 -		Uint32 mask = (srcfmt->alpha >> dstfmt->Aloss) << dstfmt->Ashift;
  1.2841 +    if (dstfmt->Amask) {
  1.2842 +        /* RGB->RGBA, SET_ALPHA */
  1.2843 +        Uint32 mask = (srcfmt->alpha >> dstfmt->Aloss) << dstfmt->Ashift;
  1.2844  
  1.2845 -		while ( height-- ) {
  1.2846 +        while (height--) {
  1.2847 +			/* *INDENT-OFF* */
  1.2848  			DUFFS_LOOP(
  1.2849  			{
  1.2850  				*dst = *src | mask;
  1.2851 @@ -2010,14 +2065,16 @@
  1.2852  				++src;
  1.2853  			},
  1.2854  			width);
  1.2855 -			src = (Uint32*)((Uint8*)src + srcskip);
  1.2856 -			dst = (Uint32*)((Uint8*)dst + dstskip);
  1.2857 -		}
  1.2858 -	} else {
  1.2859 -		/* RGBA->RGB, NO_ALPHA */
  1.2860 -		Uint32 mask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
  1.2861 +			/* *INDENT-ON* */
  1.2862 +            src = (Uint32 *) ((Uint8 *) src + srcskip);
  1.2863 +            dst = (Uint32 *) ((Uint8 *) dst + dstskip);
  1.2864 +        }
  1.2865 +    } else {
  1.2866 +        /* RGBA->RGB, NO_ALPHA */
  1.2867 +        Uint32 mask = srcfmt->Rmask | srcfmt->Gmask | srcfmt->Bmask;
  1.2868  
  1.2869 -		while ( height-- ) {
  1.2870 +        while (height--) {
  1.2871 +			/* *INDENT-OFF* */
  1.2872  			DUFFS_LOOP(
  1.2873  			{
  1.2874  				*dst = *src & mask;
  1.2875 @@ -2025,27 +2082,30 @@
  1.2876  				++src;
  1.2877  			},
  1.2878  			width);
  1.2879 -			src = (Uint32*)((Uint8*)src + srcskip);
  1.2880 -			dst = (Uint32*)((Uint8*)dst + dstskip);
  1.2881 -		}
  1.2882 -	}
  1.2883 +			/* *INDENT-ON* */
  1.2884 +            src = (Uint32 *) ((Uint8 *) src + srcskip);
  1.2885 +            dst = (Uint32 *) ((Uint8 *) dst + dstskip);
  1.2886 +        }
  1.2887 +    }
  1.2888  }
  1.2889  
  1.2890 -static void BlitNtoN(SDL_BlitInfo *info)
  1.2891 +static void
  1.2892 +BlitNtoN(SDL_BlitInfo * info)
  1.2893  {
  1.2894 -	int width = info->d_width;
  1.2895 -	int height = info->d_height;
  1.2896 -	Uint8 *src = info->s_pixels;
  1.2897 -	int srcskip = info->s_skip;
  1.2898 -	Uint8 *dst = info->d_pixels;
  1.2899 -	int dstskip = info->d_skip;
  1.2900 -	SDL_PixelFormat *srcfmt = info->src;
  1.2901 -	int srcbpp = srcfmt->BytesPerPixel;
  1.2902 -	SDL_PixelFormat *dstfmt = info->dst;
  1.2903 -	int dstbpp = dstfmt->BytesPerPixel;
  1.2904 -	unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
  1.2905 +    int width = info->d_width;
  1.2906 +    int height = info->d_height;
  1.2907 +    Uint8 *src = info->s_pixels;
  1.2908 +    int srcskip = info->s_skip;
  1.2909 +    Uint8 *dst = info->d_pixels;
  1.2910 +    int dstskip = info->d_skip;
  1.2911 +    SDL_PixelFormat *srcfmt = info->src;
  1.2912 +    int srcbpp = srcfmt->BytesPerPixel;
  1.2913 +    SDL_PixelFormat *dstfmt = info->dst;
  1.2914 +    int dstbpp = dstfmt->BytesPerPixel;
  1.2915 +    unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
  1.2916  
  1.2917 -	while ( height-- ) {
  1.2918 +    while (height--) {
  1.2919 +		/* *INDENT-OFF* */
  1.2920  		DUFFS_LOOP(
  1.2921  		{
  1.2922  		        Uint32 Pixel;
  1.2923 @@ -2058,64 +2118,66 @@
  1.2924  			src += srcbpp;
  1.2925  		},
  1.2926  		width);
  1.2927 -		src += srcskip;
  1.2928 -		dst += dstskip;
  1.2929 -	}
  1.2930 +		/* *INDENT-ON* */
  1.2931 +        src += srcskip;
  1.2932 +        dst += dstskip;
  1.2933 +    }
  1.2934  }
  1.2935  
  1.2936 -static void BlitNtoNCopyAlpha(SDL_BlitInfo *info)
  1.2937 +static void
  1.2938 +BlitNtoNCopyAlpha(SDL_BlitInfo * info)
  1.2939  {
  1.2940 -	int width = info->d_width;
  1.2941 -	int height = info->d_height;
  1.2942 -	Uint8 *src = info->s_pixels;
  1.2943 -	int srcskip = info->s_skip;
  1.2944 -	Uint8 *dst = info->d_pixels;
  1.2945 -	int dstskip = info->d_skip;
  1.2946 -	SDL_PixelFormat *srcfmt = info->src;
  1.2947 -	int srcbpp = srcfmt->BytesPerPixel;
  1.2948 -	SDL_PixelFormat *dstfmt = info->dst;
  1.2949 -	int dstbpp = dstfmt->BytesPerPixel;
  1.2950 -	int c;
  1.2951 +    int width = info->d_width;
  1.2952 +    int height = info->d_height;
  1.2953 +    Uint8 *src = info->s_pixels;
  1.2954 +    int srcskip = info->s_skip;
  1.2955 +    Uint8 *dst = info->d_pixels;
  1.2956 +    int dstskip = info->d_skip;
  1.2957 +    SDL_PixelFormat *srcfmt = info->src;
  1.2958 +    int srcbpp = srcfmt->BytesPerPixel;
  1.2959 +    SDL_PixelFormat *dstfmt = info->dst;
  1.2960 +    int dstbpp = dstfmt->BytesPerPixel;
  1.2961 +    int c;
  1.2962  
  1.2963 -	/* FIXME: should map alpha to [0..255] correctly! */
  1.2964 -	while ( height-- ) {
  1.2965 -		for ( c=width; c; --c ) {
  1.2966 -		        Uint32 Pixel;
  1.2967 -			unsigned sR, sG, sB, sA;
  1.2968 -			DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel,
  1.2969 -				      sR, sG, sB, sA);
  1.2970 -			ASSEMBLE_RGBA(dst, dstbpp, dstfmt,
  1.2971 -				      sR, sG, sB, sA);
  1.2972 -			dst += dstbpp;
  1.2973 -			src += srcbpp;
  1.2974 -		}
  1.2975 -		src += srcskip;
  1.2976 -		dst += dstskip;
  1.2977 -	}
  1.2978 +    /* FIXME: should map alpha to [0..255] correctly! */
  1.2979 +    while (height--) {
  1.2980 +        for (c = width; c; --c) {
  1.2981 +            Uint32 Pixel;
  1.2982 +            unsigned sR, sG, sB, sA;
  1.2983 +            DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
  1.2984 +            ASSEMBLE_RGBA(dst, dstbpp, dstfmt, sR, sG, sB, sA);
  1.2985 +            dst += dstbpp;
  1.2986 +            src += srcbpp;
  1.2987 +        }
  1.2988 +        src += srcskip;
  1.2989 +        dst += dstskip;
  1.2990 +    }
  1.2991  }
  1.2992  
  1.2993 -static void BlitNto1Key(SDL_BlitInfo *info)
  1.2994 +static void
  1.2995 +BlitNto1Key(SDL_BlitInfo * info)
  1.2996  {
  1.2997 -	int width = info->d_width;
  1.2998 -	int height = info->d_height;
  1.2999 -	Uint8 *src = info->s_pixels;
  1.3000 -	int srcskip = info->s_skip;
  1.3001 -	Uint8 *dst = info->d_pixels;
  1.3002 -	int dstskip = info->d_skip;
  1.3003 -	SDL_PixelFormat *srcfmt = info->src;
  1.3004 -	const Uint8 *palmap = info->table;
  1.3005 -	Uint32 ckey = srcfmt->colorkey;
  1.3006 -	Uint32 rgbmask = ~srcfmt->Amask;
  1.3007 -	int srcbpp;
  1.3008 -	Uint32 Pixel;
  1.3009 -	unsigned sR, sG, sB;
  1.3010 +    int width = info->d_width;
  1.3011 +    int height = info->d_height;
  1.3012 +    Uint8 *src = info->s_pixels;
  1.3013 +    int srcskip = info->s_skip;
  1.3014 +    Uint8 *dst = info->d_pixels;
  1.3015 +    int dstskip = info->d_skip;
  1.3016 +    SDL_PixelFormat *srcfmt = info->src;
  1.3017 +    const Uint8 *palmap = info->table;
  1.3018 +    Uint32 ckey = srcfmt->colorkey;
  1.3019 +    Uint32 rgbmask = ~srcfmt->Amask;
  1.3020 +    int srcbpp;
  1.3021 +    Uint32 Pixel;
  1.3022 +    unsigned sR, sG, sB;
  1.3023  
  1.3024 -	/* Set up some basic variables */
  1.3025 -	srcbpp = srcfmt->BytesPerPixel;
  1.3026 -	ckey &= rgbmask;
  1.3027 +    /* Set up some basic variables */
  1.3028 +    srcbpp = srcfmt->BytesPerPixel;
  1.3029 +    ckey &= rgbmask;
  1.3030  
  1.3031 -	if ( palmap == NULL ) {
  1.3032 -		while ( height-- ) {
  1.3033 +    if (palmap == NULL) {
  1.3034 +        while (height--) {
  1.3035 +			/* *INDENT-OFF* */
  1.3036  			DUFFS_LOOP(
  1.3037  			{
  1.3038  				DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
  1.3039 @@ -2130,11 +2192,13 @@
  1.3040  				src += srcbpp;
  1.3041  			},
  1.3042  			width);
  1.3043 -			src += srcskip;
  1.3044 -			dst += dstskip;
  1.3045 -		}
  1.3046 -	} else {
  1.3047 -		while ( height-- ) {
  1.3048 +			/* *INDENT-ON* */
  1.3049 +            src += srcskip;
  1.3050 +            dst += dstskip;
  1.3051 +        }
  1.3052 +    } else {
  1.3053 +        while (height--) {
  1.3054 +			/* *INDENT-OFF* */
  1.3055  			DUFFS_LOOP(
  1.3056  			{
  1.3057  				DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel,
  1.3058 @@ -2149,29 +2213,32 @@
  1.3059  				src += srcbpp;
  1.3060  			},
  1.3061  			width);
  1.3062 -			src += srcskip;
  1.3063 -			dst += dstskip;
  1.3064 -		}
  1.3065 -	}
  1.3066 +			/* *INDENT-ON* */
  1.3067 +            src += srcskip;
  1.3068 +            dst += dstskip;
  1.3069 +        }
  1.3070 +    }
  1.3071  }
  1.3072  
  1.3073 -static void Blit2to2Key(SDL_BlitInfo *info)
  1.3074 +static void
  1.3075 +Blit2to2Key(SDL_BlitInfo * info)
  1.3076  {
  1.3077 -	int width = info->d_width;
  1.3078 -	int height = info->d_height;
  1.3079 -	Uint16 *srcp = (Uint16 *)info->s_pixels;
  1.3080 -	int srcskip = info->s_skip;
  1.3081 -	Uint16 *dstp = (Uint16 *)info->d_pixels;
  1.3082 -	int dstskip = info->d_skip;
  1.3083 -	Uint32 ckey = info->src->colorkey;
  1.3084 -	Uint32 rgbmask = ~info->src->Amask;
  1.3085 +    int width = info->d_width;
  1.3086 +    int height = info->d_height;
  1.3087 +    Uint16 *srcp = (Uint16 *) info->s_pixels;
  1.3088 +    int srcskip = info->s_skip;
  1.3089 +    Uint16 *dstp = (Uint16 *) info->d_pixels;
  1.3090 +    int dstskip = info->d_skip;
  1.3091 +    Uint32 ckey = info->src->colorkey;
  1.3092 +    Uint32 rgbmask = ~info->src->Amask;
  1.3093  
  1.3094 -	/* Set up some basic variables */
  1.3095 -        srcskip /= 2;
  1.3096 -        dstskip /= 2;
  1.3097 -	ckey &= rgbmask;
  1.3098 +    /* Set up some basic variables */
  1.3099 +    srcskip /= 2;
  1.3100 +    dstskip /= 2;
  1.3101 +    ckey &= rgbmask;
  1.3102  
  1.3103 -	while ( height-- ) {
  1.3104 +    while (height--) {
  1.3105 +		/* *INDENT-OFF* */
  1.3106  		DUFFS_LOOP(
  1.3107  		{
  1.3108  			if ( (*srcp & rgbmask) != ckey ) {
  1.3109 @@ -2181,31 +2248,34 @@
  1.3110  			srcp++;
  1.3111  		},
  1.3112  		width);
  1.3113 -		srcp += srcskip;
  1.3114 -		dstp += dstskip;
  1.3115 -	}
  1.3116 +		/* *INDENT-ON* */
  1.3117 +        srcp += srcskip;
  1.3118 +        dstp += dstskip;
  1.3119 +    }
  1.3120  }
  1.3121  
  1.3122 -static void BlitNtoNKey(SDL_BlitInfo *info)
  1.3123 +static void
  1.3124 +BlitNtoNKey(SDL_BlitInfo * info)
  1.3125  {
  1.3126 -	int width = info->d_width;
  1.3127 -	int height = info->d_height;
  1.3128 -	Uint8 *src = info->s_pixels;
  1.3129 -	int srcskip = info->s_skip;
  1.3130 -	Uint8 *dst = info->d_pixels;
  1.3131 -	int dstskip = info->d_skip;
  1.3132 -	Uint32 ckey = info->src->colorkey;
  1.3133 -	SDL_PixelFormat *srcfmt = info->src;
  1.3134 -	SDL_PixelFormat *dstfmt = info->dst;
  1.3135 -	int srcbpp = srcfmt->BytesPerPixel;
  1.3136 -	int dstbpp = dstfmt->BytesPerPixel;
  1.3137 -	unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
  1.3138 -	Uint32 rgbmask = ~srcfmt->Amask;
  1.3139 +    int width = info->d_width;
  1.3140 +    int height = info->d_height;
  1.3141 +    Uint8 *src = info->s_pixels;
  1.3142 +    int srcskip = info->s_skip;
  1.3143 +    Uint8 *dst = info->d_pixels;
  1.3144 +    int dstskip = info->d_skip;
  1.3145 +    Uint32 ckey = info->src->colorkey;
  1.3146 +    SDL_PixelFormat *srcfmt = info->src;
  1.3147 +    SDL_PixelFormat *dstfmt = info->dst;
  1.3148 +    int srcbpp = srcfmt->BytesPerPixel;
  1.3149 +    int dstbpp = dstfmt->BytesPerPixel;
  1.3150 +    unsigned alpha = dstfmt->Amask ? srcfmt->alpha : 0;
  1.3151 +    Uint32 rgbmask = ~srcfmt->Amask;
  1.3152  
  1.3153 -	/* Set up some basic variables */
  1.3154 -	ckey &= rgbmask;
  1.3155 +    /* Set up some basic variables */
  1.3156 +    ckey &= rgbmask;
  1.3157  
  1.3158 -	while ( height-- ) {
  1.3159 +    while (height--) {
  1.3160 +		/* *INDENT-OFF* */
  1.3161  		DUFFS_LOOP(
  1.3162  		{
  1.3163  		        Uint32 Pixel;
  1.3164 @@ -2222,36 +2292,39 @@
  1.3165  			src += srcbpp;
  1.3166  		},
  1.3167  		width);
  1.3168 -		src += srcskip;
  1.3169 -		dst += dstskip;
  1.3170 -	}
  1.3171 +		/* *INDENT-ON* */
  1.3172 +        src += srcskip;
  1.3173 +        dst += dstskip;
  1.3174 +    }
  1.3175  }
  1.3176  
  1.3177 -static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info)
  1.3178 +static void
  1.3179 +BlitNtoNKeyCopyAlpha(SDL_BlitInfo * info)
  1.3180  {
  1.3181 -	int width = info->d_width;
  1.3182 -	int height = info->d_height;
  1.3183 -	Uint8 *src = info->s_pixels;
  1.3184 -	int srcskip = info->s_skip;
  1.3185 -	Uint8 *dst = info->d_pixels;
  1.3186 -	int dstskip = info->d_skip;
  1.3187 -	Uint32 ckey = info->src->colorkey;
  1.3188 -	SDL_PixelFormat *srcfmt = info->src;
  1.3189 -	SDL_PixelFormat *dstfmt = info->dst;
  1.3190 -	Uint32 rgbmask = ~srcfmt->Amask;
  1.3191 +    int width = info->d_width;
  1.3192 +    int height = info->d_height;
  1.3193 +    Uint8 *src = info->s_pixels;
  1.3194 +    int srcskip = info->s_skip;
  1.3195 +    Uint8 *dst = info->d_pixels;
  1.3196 +    int dstskip = info->d_skip;
  1.3197 +    Uint32 ckey = info->src->colorkey;
  1.3198 +    SDL_PixelFormat *srcfmt = info->src;
  1.3199 +    SDL_PixelFormat *dstfmt = info->dst;
  1.3200 +    Uint32 rgbmask = ~srcfmt->Amask;
  1.3201  
  1.3202 -	Uint8 srcbpp;
  1.3203 -	Uint8 dstbpp;
  1.3204 -	Uint32 Pixel;
  1.3205 -	unsigned sR, sG, sB, sA;
  1.3206 +    Uint8 srcbpp;
  1.3207 +    Uint8 dstbpp;
  1.3208 +    Uint32 Pixel;
  1.3209 +    unsigned sR, sG, sB, sA;
  1.3210  
  1.3211 -	/* Set up some basic variables */
  1.3212 -	srcbpp = srcfmt->BytesPerPixel;
  1.3213 -	dstbpp = dstfmt->BytesPerPixel;
  1.3214 -	ckey &= rgbmask;
  1.3215 +    /* Set up some basic variables */
  1.3216 +    srcbpp = srcfmt->BytesPerPixel;
  1.3217 +    dstbpp = dstfmt->BytesPerPixel;
  1.3218 +    ckey &= rgbmask;
  1.3219  
  1.3220 -	/* FIXME: should map alpha to [0..255] correctly! */
  1.3221 -	while ( height-- ) {
  1.3222 +    /* FIXME: should map alpha to [0..255] correctly! */
  1.3223 +    while (height--) {
  1.3224 +		/* *INDENT-OFF* */
  1.3225  		DUFFS_LOOP(
  1.3226  		{
  1.3227  			DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel,
  1.3228 @@ -2264,227 +2337,261 @@
  1.3229  			src += srcbpp;
  1.3230  		},
  1.3231  		width);
  1.3232 -		src += srcskip;
  1.3233 -		dst += dstskip;
  1.3234 -	}
  1.3235 +		/* *INDENT-ON* */
  1.3236 +        src += srcskip;
  1.3237 +        dst += dstskip;
  1.3238 +    }
  1.3239  }
  1.3240  
  1.3241  /* Normal N to N optimized blitters */
  1.3242 -struct blit_table {
  1.3243 -	Uint32 srcR, srcG, srcB;
  1.3244 -	int dstbpp;
  1.3245 -	Uint32 dstR, dstG, dstB;
  1.3246 -	Uint32 blit_features;
  1.3247 -	void *aux_data;
  1.3248 -	SDL_loblit blitfunc;
  1.3249 -	enum { NO_ALPHA=1, SET_ALPHA=2, COPY_ALPHA=4 } alpha;
  1.3250 +struct blit_table
  1.3251 +{
  1.3252 +    Uint32 srcR, srcG, srcB;
  1.3253 +    int dstbpp;
  1.3254 +    Uint32 dstR, dstG, dstB;
  1.3255 +    Uint32 blit_features;
  1.3256 +    void *aux_data;
  1.3257 +    SDL_loblit blitfunc;
  1.3258 +    enum
  1.3259 +    { NO_ALPHA = 1, SET_ALPHA = 2, COPY_ALPHA = 4 } alpha;
  1.3260  };
  1.3261  static const struct blit_table normal_blit_1[] = {
  1.3262 -	/* Default for 8-bit RGB source, an invalid combination */
  1.3263 -	{ 0,0,0, 0, 0,0,0, 0, NULL, NULL },
  1.3264 +    /* Default for 8-bit RGB source, an invalid combination */
  1.3265 +    {0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL},
  1.3266  };
  1.3267  static const struct blit_table normal_blit_2[] = {
  1.3268  #if SDL_HERMES_BLITTERS
  1.3269 -    { 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000007E0,0x0000F800,
  1.3270 -      0, ConvertX86p16_16BGR565, ConvertX86, NO_ALPHA },
  1.3271 -    { 0x0000F800,0x000007E0,0x0000001F, 2, 0x00007C00,0x000003E0,0x0000001F,
  1.3272 -      0, ConvertX86p16_16RGB555, ConvertX86, NO_ALPHA },
  1.3273 -    { 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000003E0,0x00007C00,
  1.3274 -      0, ConvertX86p16_16BGR555, ConvertX86, NO_ALPHA },
  1.3275 +    {0x0000F800, 0x000007E0, 0x0000001F, 2, 0x0000001F, 0x000007E0,
  1.3276 +     0x0000F800,
  1.3277 +     0, ConvertX86p16_16BGR565, ConvertX86, NO_ALPHA},
  1.3278 +    {0x0000F800, 0x000007E0, 0x0000001F, 2, 0x00007C00, 0x000003E0,
  1.3279 +     0x0000001F,
  1.3280 +     0, ConvertX86p16_16RGB555, ConvertX86, NO_ALPHA},
  1.3281 +    {0x0000F800, 0x000007E0, 0x0000001F, 2, 0x0000001F, 0x000003E0,
  1.3282 +     0x00007C00,
  1.3283 +     0, ConvertX86p16_16BGR555, ConvertX86, NO_ALPHA},
  1.3284  #elif SDL_ALTIVEC_BLITTERS
  1.3285      /* has-altivec */
  1.3286 -    { 0x0000F800,0x000007E0,0x0000001F, 4, 0x00000000,0x00000000,0x00000000,
  1.3287 -      2, NULL, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
  1.3288 -    { 0x00007C00,0x000003E0,0x0000001F, 4, 0x00000000,0x00000000,0x00000000,
  1.3289 -      2, NULL, Blit_RGB555_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
  1.3290 +    {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00000000, 0x00000000,
  1.3291 +     0x00000000,
  1.3292 +     2, NULL, Blit_RGB565_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
  1.3293 +    {0x00007C00, 0x000003E0, 0x0000001F, 4, 0x00000000, 0x00000000,
  1.3294 +     0x00000000,
  1.3295 +     2, NULL, Blit_RGB555_32Altivec, NO_ALPHA | COPY_ALPHA | SET_ALPHA},
  1.3296  #endif
  1.3297 -    { 0x0000F800,0x000007E0,0x0000001F, 4, 0x00FF0000,0x0000FF00,0x000000FF,
  1.3298 -      0, NULL, Blit_RGB565_ARGB8888, SET_ALPHA },
  1.3299 -    { 0x0000F800,0x000007E0,0x0000001F, 4, 0x000000FF,0x0000FF00,0x00FF0000,
  1.3300 -      0, NULL, Blit_RGB565_ABGR8888, SET_ALPHA },
  1.3301 -    { 0x0000F800,0x000007E0,0x0000001F, 4, 0xFF000000,0x00FF0000,0x0000FF00,
  1.3302 -      0, NULL, Blit_RGB565_RGBA8888, SET_ALPHA },
  1.3303 -    { 0x0000F800,0x000007E0,0x0000001F, 4, 0x0000FF00,0x00FF0000,0xFF000000,
  1.3304 -      0, NULL, Blit_RGB565_BGRA8888, SET_ALPHA },
  1.3305 +    {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x00FF0000, 0x0000FF00,
  1.3306 +     0x000000FF,
  1.3307 +     0, NULL, Blit_RGB565_ARGB8888, SET_ALPHA},
  1.3308 +    {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x000000FF, 0x0000FF00,
  1.3309 +     0x00FF0000,
  1.3310 +     0, NULL, Blit_RGB565_ABGR8888, SET_ALPHA},
  1.3311 +    {0x0000F800, 0x000007E0, 0x0000001F, 4, 0xFF000000, 0x00FF0000,
  1.3312 +     0x0000FF00,
  1.3313 +     0, NULL, Blit_RGB565_RGBA8888, SET_ALPHA},
  1.3314 +    {0x0000F800, 0x000007E0, 0x0000001F, 4, 0x0000FF00, 0x00FF0000,
  1.3315 +     0xFF000000,
  1.3316 +     0, NULL, Blit_RGB565_BGRA8888, SET_ALPHA},
  1.3317  
  1.3318      /* Default for 16-bit RGB source, used if no other blitter matches */
  1.3319 -    { 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
  1.3320 +    {0, 0, 0, 0, 0, 0, 0, 0, NULL, BlitNtoN, 0}
  1.3321  };
  1.3322  static const struct blit_table normal_blit_3[] = {
  1.3323 -	/* Default for 24-bit RGB source, never optimized */
  1.3324 -    { 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
  1.3325 +    /* Default for 24-bit RGB source, never optimized */
  1.3326 +    {0, 0, 0, 0, 0, 0, 0, 0, NULL, BlitNtoN, 0}
  1.3327  };
  1.3328  static const struct blit_table normal_blit_4[] = {
  1.3329  #if SDL_HERMES_BLITTERS
  1.3330 -    { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
  1.3331 -      1, ConvertMMXpII32_16RGB565, ConvertMMX, NO_ALPHA },
  1.3332 -    { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
  1.3333 -      0, ConvertX86p32_16RGB565, ConvertX86, NO_ALPHA },
  1.3334 -    { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800,
  1.3335 -      1, ConvertMMXpII32_16BGR565, ConvertMMX, NO_ALPHA },
  1.3336 -    { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000007E0,0x0000F800,
  1.3337 -      0, ConvertX86p32_16BGR565, ConvertX86, NO_ALPHA },
  1.3338 -    { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
  1.3339 -      1, ConvertMMXpII32_16RGB555, ConvertMMX, NO_ALPHA },
  1.3340 -    { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
  1.3341 -      0, ConvertX86p32_16RGB555, ConvertX86, NO_ALPHA },
  1.3342 -    { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00,
  1.3343 -      1, ConvertMMXpII32_16BGR555, ConvertMMX, NO_ALPHA },
  1.3344 -    { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000001F,0x000003E0,0x00007C00,
  1.3345 -      0, ConvertX86p32_16BGR555, ConvertX86, NO_ALPHA },
  1.3346 -    { 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x00FF0000,0x0000FF00,0x000000FF,
  1.3347 -      0, ConvertX86p32_24RGB888, ConvertX86, NO_ALPHA },
  1.3348 -    { 0x00FF0000,0x0000FF00,0x000000FF, 3, 0x000000FF,0x0000FF00,0x00FF0000,
  1.3349 -      0, ConvertX86p32_24BGR888, ConvertX86, NO_ALPHA },
  1.3350 -    { 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x000000FF,0x0000FF00,0x00FF0000,
  1.3351 -      0, ConvertX86p32_32BGR888, ConvertX86, NO_ALPHA },
  1.3352 -    { 0x00FF0000,0x0000FF00,0x000000FF, 4, 0xFF000000,0x00FF0000,0x0000FF00,
  1.3353 -      0, ConvertX86p32_32RGBA888, ConvertX86, NO_ALPHA },
  1.3354 -    { 0x00FF0000,0x0000FF00,0x000000FF, 4, 0x0000FF00,0x00FF0000,0xFF000000,
  1.3355 -      0, ConvertX86p32_32BGRA888, ConvertX86, NO_ALPHA },
  1.3356 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000F800, 0x000007E0,
  1.3357 +     0x0000001F,
  1.3358 +     1, ConvertMMXpII32_16RGB565, ConvertMMX, NO_ALPHA},
  1.3359 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000F800, 0x000007E0,
  1.3360 +     0x0000001F,
  1.3361 +     0, ConvertX86p32_16RGB565, ConvertX86, NO_ALPHA},
  1.3362 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000001F, 0x000007E0,
  1.3363 +     0x0000F800,
  1.3364 +     1, ConvertMMXpII32_16BGR565, ConvertMMX, NO_ALPHA},
  1.3365 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000001F, 0x000007E0,
  1.3366 +     0x0000F800,
  1.3367 +     0, ConvertX86p32_16BGR565, ConvertX86, NO_ALPHA},
  1.3368 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x00007C00, 0x000003E0,
  1.3369 +     0x0000001F,
  1.3370 +     1, ConvertMMXpII32_16RGB555, ConvertMMX, NO_ALPHA},
  1.3371 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x00007C00, 0x000003E0,
  1.3372 +     0x0000001F,
  1.3373 +     0, ConvertX86p32_16RGB555, ConvertX86, NO_ALPHA},
  1.3374 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000001F, 0x000003E0,
  1.3375 +     0x00007C00,
  1.3376 +     1, ConvertMMXpII32_16BGR555, ConvertMMX, NO_ALPHA},
  1.3377 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000001F, 0x000003E0,
  1.3378 +     0x00007C00,
  1.3379 +     0, ConvertX86p32_16BGR555, ConvertX86, NO_ALPHA},
  1.3380 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 3, 0x00FF0000, 0x0000FF00,
  1.3381 +     0x000000FF,
  1.3382 +     0, ConvertX86p32_24RGB888, ConvertX86, NO_ALPHA},
  1.3383 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 3, 0x000000FF, 0x0000FF00,
  1.3384 +     0x00FF0000,
  1.3385 +     0, ConvertX86p32_24BGR888, ConvertX86, NO_ALPHA},
  1.3386 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 4, 0x000000FF, 0x0000FF00,
  1.3387 +     0x00FF0000,
  1.3388 +     0, ConvertX86p32_32BGR888, ConvertX86, NO_ALPHA},
  1.3389 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 4, 0xFF000000, 0x00FF0000,
  1.3390 +     0x0000FF00,
  1.3391 +     0, ConvertX86p32_32RGBA888, ConvertX86, NO_ALPHA},
  1.3392 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 4, 0x0000FF00, 0x00FF0000,
  1.3393 +     0xFF000000,
  1.3394 +     0, ConvertX86p32_32BGRA888, ConvertX86, NO_ALPHA},
  1.3395  #else
  1.3396  #if SDL_ALTIVEC_BLITTERS
  1.3397      /* has-altivec | dont-use-prefetch */
  1.3398 -    { 0x00000000,0x00000000,0x00000000, 4, 0x00000000,0x00000000,0x00000000,
  1.3399 -      6, NULL, ConvertAltivec32to32_noprefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
  1.3400 +    {0x00000000, 0x00000000, 0x00000000, 4, 0x00000000, 0x00000000,
  1.3401 +     0x00000000,
  1.3402 +     6, NULL, ConvertAltivec32to32_noprefetch,
  1.3403 +     NO_ALPHA | COPY_ALPHA | SET_ALPHA},
  1.3404      /* has-altivec */
  1.3405 -    { 0x00000000,0x00000000,0x00000000, 4, 0x00000000,0x00000000,0x00000000,
  1.3406 -      2, NULL, ConvertAltivec32to32_prefetch, NO_ALPHA | COPY_ALPHA | SET_ALPHA },
  1.3407 +    {0x00000000, 0x00000000, 0x00000000, 4, 0x00000000, 0x00000000,
  1.3408 +     0x00000000,
  1.3409 +     2, NULL, ConvertAltivec32to32_prefetch,
  1.3410 +     NO_ALPHA | COPY_ALPHA | SET_ALPHA},
  1.3411      /* has-altivec */
  1.3412 -    { 0x00000000,0x00000000,0x00000000, 2, 0x0000F800,0x000007E0,0x0000001F,
  1.3413 -      2, NULL, Blit_RGB888_RGB565Altivec, NO_ALPHA },
  1.3414 +    {0x00000000, 0x00000000, 0x00000000, 2, 0x0000F800, 0x000007E0,
  1.3415 +     0x0000001F,
  1.3416 +     2, NULL, Blit_RGB888_RGB565Altivec, NO_ALPHA},
  1.3417  #endif
  1.3418 -    { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
  1.3419 -      0, NULL, Blit_RGB888_RGB565, NO_ALPHA },
  1.3420 -    { 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x00007C00,0x000003E0,0x0000001F,
  1.3421 -      0, NULL, Blit_RGB888_RGB555, NO_ALPHA },
  1.3422 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x0000F800, 0x000007E0,
  1.3423 +     0x0000001F,
  1.3424 +     0, NULL, Blit_RGB888_RGB565, NO_ALPHA},
  1.3425 +    {0x00FF0000, 0x0000FF00, 0x000000FF, 2, 0x00007C00, 0x000003E0,
  1.3426 +     0x0000001F,
  1.3427 +     0, NULL, Blit_RGB888_RGB555, NO_ALPHA},
  1.3428  #endif
  1.3429 -	/* Default for 32-bit RGB source, used if no other blitter matches */
  1.3430 -	{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
  1.3431 +    /* Default for 32-bit RGB source, used if no other blitter matches */
  1.3432 +    {0, 0, 0, 0, 0, 0, 0, 0, NULL, BlitNtoN, 0}
  1.3433  };
  1.3434  static const struct blit_table *normal_blit[] = {
  1.3435 -	normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4
  1.3436 +    normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4
  1.3437  };
  1.3438  
  1.3439  /* Mask matches table, or table entry is zero */
  1.3440  #define MASKOK(x, y) (((x) == (y)) || ((y) == 0x00000000))
  1.3441  
  1.3442 -SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int blit_index)
  1.3443 +SDL_loblit
  1.3444 +SDL_CalculateBlitN(SDL_Surface * surface, int blit_index)
  1.3445  {
  1.3446 -	struct private_swaccel *sdata;
  1.3447 -	SDL_PixelFormat *srcfmt;
  1.3448 -	SDL_PixelFormat *dstfmt;
  1.3449 -	const struct blit_table *table;
  1.3450 -	int which;
  1.3451 -	SDL_loblit blitfun;
  1.3452 +    struct private_swaccel *sdata;
  1.3453 +    SDL_PixelFormat *srcfmt;
  1.3454 +    SDL_PixelFormat *dstfmt;
  1.3455 +    const struct blit_table *table;
  1.3456 +    int which;
  1.3457 +    SDL_loblit blitfun;
  1.3458  
  1.3459 -	/* Set up data for choosing the blit */
  1.3460 -	sdata = surface->map->sw_data;
  1.3461 -	srcfmt = surface->format;
  1.3462 -	dstfmt = surface->map->dst->format;
  1.3463 +    /* Set up data for choosing the blit */
  1.3464 +    sdata = surface->map->sw_data;
  1.3465 +    srcfmt = surface->format;
  1.3466 +    dstfmt = surface->map->dst->format;
  1.3467  
  1.3468 -	if ( blit_index & 2 ) {
  1.3469 -	        /* alpha or alpha+colorkey */
  1.3470 -	        return SDL_CalculateAlphaBlit(surface, blit_index);
  1.3471 -	}
  1.3472 +    if (blit_index & 2) {
  1.3473 +        /* alpha or alpha+colorkey */
  1.3474 +        return SDL_CalculateAlphaBlit(surface, blit_index);
  1.3475 +    }
  1.3476  
  1.3477 -	/* We don't support destinations less than 8-bits */
  1.3478 -	if ( dstfmt->BitsPerPixel < 8 ) {
  1.3479 -		return(NULL);
  1.3480 -	}
  1.3481 -	
  1.3482 -	if(blit_index == 1) {
  1.3483 -	    /* colorkey blit: Here we don't have too many options, mostly
  1.3484 -	       because RLE is the preferred fast way to deal with this.
  1.3485 -	       If a particular case turns out to be useful we'll add it. */
  1.3486 +    /* We don't support destinations less than 8-bits */
  1.3487 +    if (dstfmt->BitsPerPixel < 8) {
  1.3488 +        return (NULL);
  1.3489 +    }
  1.3490  
  1.3491 -	    if(srcfmt->BytesPerPixel == 2
  1.3492 -	       && surface->map->identity)
  1.3493 -		return Blit2to2Key;
  1.3494 -	    else if(dstfmt->BytesPerPixel == 1)
  1.3495 -		return BlitNto1Key;
  1.3496 -	    else {
  1.3497 +    if (blit_index == 1) {
  1.3498 +        /* colorkey blit: Here we don't have too many options, mostly
  1.3499 +           because RLE is the preferred fast way to deal with this.
  1.3500 +           If a particular case turns out to be useful we'll add it. */
  1.3501 +
  1.3502 +        if (srcfmt->BytesPerPixel == 2 && surface->map->identity)
  1.3503 +            return Blit2to2Key;
  1.3504 +        else if (dstfmt->BytesPerPixel == 1)
  1.3505 +            return BlitNto1Key;
  1.3506 +        else {
  1.3507  #if SDL_ALTIVEC_BLITTERS
  1.3508 -        if((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4) && SDL_HasAltiVec()) {
  1.3509 -            return Blit32to32KeyAltivec;
  1.3510 -        } else
  1.3511 +            if ((srcfmt->BytesPerPixel == 4) && (dstfmt->BytesPerPixel == 4)
  1.3512 +                && SDL_HasAltiVec()) {
  1.3513 +                return Blit32to32KeyAltivec;
  1.3514 +            } else
  1.3515  #endif
  1.3516  
  1.3517 -		if(srcfmt->Amask && dstfmt->Amask)
  1.3518 -		    return BlitNtoNKeyCopyAlpha;
  1.3519 -		else
  1.3520 -		    return BlitNtoNKey;
  1.3521 -	    }
  1.3522 -	}
  1.3523 +            if (srcfmt->Amask && dstfmt->Amask)
  1.3524 +                return BlitNtoNKeyCopyAlpha;
  1.3525 +            else
  1.3526 +                return BlitNtoNKey;
  1.3527 +        }
  1.3528 +    }
  1.3529  
  1.3530 -	blitfun = NULL;
  1.3531 -	if ( dstfmt->BitsPerPixel == 8 ) {
  1.3532 -		/* We assume 8-bit destinations are palettized */
  1.3533 -		if ( (srcfmt->BytesPerPixel == 4) &&
  1.3534 -		     (srcfmt->Rmask == 0x00FF0000) &&
  1.3535 -		     (srcfmt->Gmask == 0x0000FF00) &&
  1.3536 -		     (srcfmt->Bmask == 0x000000FF) ) {
  1.3537 -			if ( surface->map->table ) {
  1.3538 -				blitfun = Blit_RGB888_index8_map;
  1.3539 -			} else {
  1.3540 +    blitfun = NULL;
  1.3541 +    if (dstfmt->BitsPerPixel == 8) {
  1.3542 +        /* We assume 8-bit destinations are palettized */
  1.3543 +        if ((srcfmt->BytesPerPixel == 4) &&
  1.3544 +            (srcfmt->Rmask == 0x00FF0000) &&
  1.3545 +            (srcfmt->Gmask == 0x0000FF00) && (srcfmt->Bmask == 0x000000FF)) {
  1.3546 +            if (surface->map->table) {
  1.3547 +                blitfun = Blit_RGB888_index8_map;
  1.3548 +            } else {
  1.3549  #if SDL_HERMES_BLITTERS
  1.3550 -				sdata->aux_data = ConvertX86p32_8RGB332;
  1.3551 -				blitfun = ConvertX86;
  1.3552 +                sdata->aux_data = ConvertX86p32_8RGB332;
  1.3553 +                blitfun = ConvertX86;
  1.3554  #else
  1.3555 -				blitfun = Blit_RGB888_index8;
  1.3556 +                blitfun = Blit_RGB888_index8;
  1.3557  #endif
  1.3558 -			}
  1.3559 -		} else {
  1.3560 -			blitfun = BlitNto1;
  1.3561 -		}
  1.3562 -	} else {
  1.3563 -		/* Now the meat, choose the blitter we want */
  1.3564 -		int a_need = NO_ALPHA;
  1.3565 -		if(dstfmt->Amask)
  1.3566 -		    a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
  1.3567 -		table = normal_blit[srcfmt->BytesPerPixel-1];
  1.3568 -		for ( which=0; table[which].dstbpp; ++which ) {
  1.3569 -			if ( MASKOK(srcfmt->Rmask, table[which].srcR) &&
  1.3570 -			    MASKOK(srcfmt->Gmask, table[which].srcG) &&
  1.3571 -			    MASKOK(srcfmt->Bmask, table[which].srcB) &&
  1.3572 -			    MASKOK(dstfmt->Rmask, table[which].dstR) &&
  1.3573 -			    MASKOK(dstfmt->Gmask, table[which].dstG) &&
  1.3574 -			    MASKOK(dstfmt->Bmask, table[which].dstB) &&
  1.3575 -			    dstfmt->BytesPerPixel == table[which].dstbpp &&
  1.3576 -			    (a_need & table[which].alpha) == a_need &&
  1.3577 -			    ((table[which].blit_features & GetBlitFeatures()) == table[which].blit_features) )
  1.3578 -				break;
  1.3579 -		}
  1.3580 -		sdata->aux_data = table[which].aux_data;
  1.3581 -		blitfun = table[which].blitfunc;
  1.3582 +            }
  1.3583 +        } else {
  1.3584 +            blitfun = BlitNto1;
  1.3585 +        }
  1.3586 +    } else {
  1.3587 +        /* Now the meat, choose the blitter we want */
  1.3588 +        int a_need = NO_ALPHA;
  1.3589 +        if (dstfmt->Amask)
  1.3590 +            a_need = srcfmt->Amask ? COPY_ALPHA : SET_ALPHA;
  1.3591 +        table = normal_blit[srcfmt->BytesPerPixel - 1];
  1.3592 +        for (which = 0; table[which].dstbpp; ++which) {
  1.3593 +            if (MASKOK(srcfmt->Rmask, table[which].srcR) &&
  1.3594 +                MASKOK(srcfmt->Gmask, table[which].srcG) &&
  1.3595 +                MASKOK(srcfmt->Bmask, table[which].srcB) &&
  1.3596 +                MASKOK(dstfmt->Rmask, table[which].dstR) &&
  1.3597 +                MASKOK(dstfmt->Gmask, table[which].dstG) &&
  1.3598 +                MASKOK(dstfmt->Bmask, table[which].dstB) &&
  1.3599 +                dstfmt->BytesPerPixel == table[which].dstbpp &&
  1.3600 +                (a_need & table[which].alpha) == a_need &&
  1.3601 +                ((table[which].blit_features & GetBlitFeatures()) ==
  1.3602 +                 table[which].blit_features))
  1.3603 +                break;
  1.3604 +        }
  1.3605 +        sdata->aux_data = table[which].aux_data;
  1.3606 +        blitfun = table[which].blitfunc;
  1.3607  
  1.3608 -		if(blitfun == BlitNtoN) {  /* default C fallback catch-all. Slow! */
  1.3609 -			/* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */
  1.3610 -			if ( srcfmt->BytesPerPixel == 4 && dstfmt->BytesPerPixel == 4 &&
  1.3611 -			     srcfmt->Rmask == dstfmt->Rmask &&
  1.3612 -			     srcfmt->Gmask == dstfmt->Gmask &&
  1.3613 -			     srcfmt->Bmask == dstfmt->Bmask ) {
  1.3614 -				blitfun = Blit4to4MaskAlpha;
  1.3615 -			} else if ( a_need == COPY_ALPHA ) {
  1.3616 -			    blitfun = BlitNtoNCopyAlpha;
  1.3617 -			}
  1.3618 -		}
  1.3619 -	}
  1.3620 +        if (blitfun == BlitNtoN) {      /* default C fallback catch-all. Slow! */
  1.3621 +            /* Fastpath C fallback: 32bit RGB<->RGBA blit with matching RGB */
  1.3622 +            if (srcfmt->BytesPerPixel == 4 && dstfmt->BytesPerPixel == 4 &&
  1.3623 +                srcfmt->Rmask == dstfmt->Rmask &&
  1.3624 +                srcfmt->Gmask == dstfmt->Gmask &&
  1.3625 +                srcfmt->Bmask == dstfmt->Bmask) {
  1.3626 +                blitfun = Blit4to4MaskAlpha;
  1.3627 +            } else if (a_need == COPY_ALPHA) {
  1.3628 +                blitfun = BlitNtoNCopyAlpha;
  1.3629 +            }
  1.3630 +        }
  1.3631 +    }
  1.3632  
  1.3633  #ifdef DEBUG_ASM
  1.3634  #if SDL_HERMES_BLITTERS
  1.3635 -	if ( blitfun == ConvertMMX )
  1.3636 -		fprintf(stderr, "Using mmx blit\n");
  1.3637 -	else
  1.3638 -	if ( blitfun == ConvertX86 )
  1.3639 -		fprintf(stderr, "Using asm blit\n");
  1.3640 -	else
  1.3641 +    if (blitfun == ConvertMMX)
  1.3642 +        fprintf(stderr, "Using mmx blit\n");
  1.3643 +    else if (blitfun == ConvertX86)
  1.3644 +        fprintf(stderr, "Using asm blit\n");
  1.3645 +    else
  1.3646  #endif
  1.3647 -	if ( (blitfun == BlitNtoN) || (blitfun == BlitNto1) )
  1.3648 -		fprintf(stderr, "Using C blit\n");
  1.3649 -	else
  1.3650 -		fprintf(stderr, "Using optimized C blit\n");
  1.3651 +    if ((blitfun == BlitNtoN) || (blitfun == BlitNto1))
  1.3652 +        fprintf(stderr, "Using C blit\n");
  1.3653 +    else
  1.3654 +        fprintf(stderr, "Using optimized C blit\n");
  1.3655  #endif /* DEBUG_ASM */
  1.3656  
  1.3657 -	return(blitfun);
  1.3658 +    return (blitfun);
  1.3659  }
  1.3660 +
  1.3661 +/* vi: set ts=4 sw=4 expandtab: */