Fixed bug 4903 - Lack of color multiply with alpha (SDL_BLENDMODE_MOD + SDL_BLENDMODE_BLEND) blending mode for all renderers
authorSam Lantinga <slouken@libsdl.org>
Thu, 16 Jan 2020 08:52:59 -0800
changeset 134182d5b5a5ccbfb
parent 13417 77bd9fb870f7
child 13419 ccc18f2fc5d2
Fixed bug 4903 - Lack of color multiply with alpha (SDL_BLENDMODE_MOD + SDL_BLENDMODE_BLEND) blending mode for all renderers

Konrad

This kind of blending is rather quite useful and in my opinion should be available for all renderers. I do need it myself, but since I didn't want to use a custom blending mode which is supported only by certain renderers (e.g. not in software which is quite important for me) I did write implementation of SDL_BLENDMODE_MUL for all renderers altogether.

SDL_BLENDMODE_MUL implements following equation:

dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
dstA = (srcA * dstA) + (dstA * (1-srcA))

Background:

https://i.imgur.com/UsYhydP.png

Blended texture:

https://i.imgur.com/0juXQcV.png

Result for SDL_BLENDMODE_MOD:

https://i.imgur.com/wgNSgUl.png

Result for SDL_BLENDMODE_MUL:

https://i.imgur.com/Veokzim.png

I think I did cover all possibilities within included patch, but I didn't write any tests for SDL_BLENDMODE_MUL, so it would be lovely if someone could do it.
include/SDL_blendmode.h
src/render/SDL_render.c
src/render/direct3d11/SDL_render_d3d11.c
src/render/metal/SDL_render_metal.m
src/render/psp/SDL_render_psp.c
src/render/software/SDL_blendfillrect.c
src/render/software/SDL_blendline.c
src/render/software/SDL_blendpoint.c
src/render/software/SDL_draw.h
src/render/software/SDL_render_sw.c
src/render/software/SDL_rotate.c
src/video/SDL_RLEaccel.c
src/video/SDL_blit.c
src/video/SDL_blit.h
src/video/SDL_blit_auto.c
src/video/SDL_blit_slow.c
src/video/SDL_surface.c
src/video/directfb/SDL_DirectFB_render.c
src/video/sdlgenblit.pl
     1.1 --- a/include/SDL_blendmode.h	Wed Jan 15 22:18:31 2020 -0800
     1.2 +++ b/include/SDL_blendmode.h	Thu Jan 16 08:52:59 2020 -0800
     1.3 @@ -50,6 +50,9 @@
     1.4      SDL_BLENDMODE_MOD = 0x00000004,      /**< color modulate
     1.5                                                dstRGB = srcRGB * dstRGB
     1.6                                                dstA = dstA */
     1.7 +    SDL_BLENDMODE_MUL = 0x00000008,      /**< color multiply
     1.8 +                                              dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA))
     1.9 +                                              dstA = (srcA * dstA) + (dstA * (1-srcA)) */
    1.10      SDL_BLENDMODE_INVALID = 0x7FFFFFFF
    1.11  
    1.12      /* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */
     2.1 --- a/src/render/SDL_render.c	Wed Jan 15 22:18:31 2020 -0800
     2.2 +++ b/src/render/SDL_render.c	Thu Jan 16 08:52:59 2020 -0800
     2.3 @@ -75,6 +75,10 @@
     2.4      SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_SRC_COLOR, SDL_BLENDOPERATION_ADD, \
     2.5                            SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD)
     2.6  
     2.7 +#define SDL_BLENDMODE_MUL_FULL \
     2.8 +    SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_DST_COLOR, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, \
     2.9 +                          SDL_BLENDFACTOR_DST_ALPHA, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD)
    2.10 +
    2.11  #if !SDL_RENDER_DISABLED
    2.12  static const SDL_RenderDriver *render_drivers[] = {
    2.13  #if SDL_VIDEO_RENDER_D3D
    2.14 @@ -970,6 +974,7 @@
    2.15      case SDL_BLENDMODE_BLEND:
    2.16      case SDL_BLENDMODE_ADD:
    2.17      case SDL_BLENDMODE_MOD:
    2.18 +    case SDL_BLENDMODE_MUL:
    2.19          return SDL_TRUE;
    2.20  
    2.21      default:
    2.22 @@ -3288,6 +3293,9 @@
    2.23      if (blendMode == SDL_BLENDMODE_MOD_FULL) {
    2.24          return SDL_BLENDMODE_MOD;
    2.25      }
    2.26 +    if (blendMode == SDL_BLENDMODE_MUL_FULL) {
    2.27 +        return SDL_BLENDMODE_MUL;
    2.28 +    }
    2.29      return blendMode;
    2.30  }
    2.31  
    2.32 @@ -3306,6 +3314,9 @@
    2.33      if (blendMode == SDL_BLENDMODE_MOD) {
    2.34          return SDL_BLENDMODE_MOD_FULL;
    2.35      }
    2.36 +    if (blendMode == SDL_BLENDMODE_MUL) {
    2.37 +        return SDL_BLENDMODE_MUL_FULL;
    2.38 +    }
    2.39      return blendMode;
    2.40  }
    2.41  
     3.1 --- a/src/render/direct3d11/SDL_render_d3d11.c	Wed Jan 15 22:18:31 2020 -0800
     3.2 +++ b/src/render/direct3d11/SDL_render_d3d11.c	Thu Jan 16 08:52:59 2020 -0800
     3.3 @@ -636,7 +636,8 @@
     3.4      /* Create blending states: */
     3.5      if (!D3D11_CreateBlendState(renderer, SDL_BLENDMODE_BLEND) ||
     3.6          !D3D11_CreateBlendState(renderer, SDL_BLENDMODE_ADD) ||
     3.7 -        !D3D11_CreateBlendState(renderer, SDL_BLENDMODE_MOD)) {
     3.8 +        !D3D11_CreateBlendState(renderer, SDL_BLENDMODE_MOD) ||
     3.9 +        !D3D11_CreateBlendState(renderer, SDL_BLENDMODE_MUL)) {
    3.10          /* D3D11_CreateBlendMode will set the SDL error, if it fails */
    3.11          goto done;
    3.12      }
     4.1 --- a/src/render/metal/SDL_render_metal.m	Wed Jan 15 22:18:31 2020 -0800
     4.2 +++ b/src/render/metal/SDL_render_metal.m	Thu Jan 16 08:52:59 2020 -0800
     4.3 @@ -357,6 +357,7 @@
     4.4      MakePipelineState(data, cache, @" (blend=blend)", SDL_BLENDMODE_BLEND);
     4.5      MakePipelineState(data, cache, @" (blend=add)", SDL_BLENDMODE_ADD);
     4.6      MakePipelineState(data, cache, @" (blend=mod)", SDL_BLENDMODE_MOD);
     4.7 +    MakePipelineState(data, cache, @" (blend=mul)", SDL_BLENDMODE_MUL);
     4.8  }
     4.9  
    4.10  static void
     5.1 --- a/src/render/psp/SDL_render_psp.c	Wed Jan 15 22:18:31 2020 -0800
     5.2 +++ b/src/render/psp/SDL_render_psp.c	Thu Jan 16 08:52:59 2020 -0800
     5.3 @@ -676,7 +676,12 @@
     5.4          case SDL_BLENDMODE_MOD:
     5.5                  sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA);
     5.6                  sceGuEnable(GU_BLEND);
     5.7 -                sceGuBlendFunc( GU_ADD, GU_FIX, GU_SRC_COLOR, 0, 0);
     5.8 +                sceGuBlendFunc(GU_ADD, GU_FIX, GU_SRC_COLOR, 0, 0);
     5.9 +            break;
    5.10 +        case SDL_BLENDMODE_MUL:
    5.11 +                sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA);
    5.12 +                sceGuEnable(GU_BLEND);
    5.13 +                sceGuBlendFunc(GU_ADD, GU_DST_COLOR, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
    5.14              break;
    5.15          }
    5.16          data->currentBlendMode = blendMode;
     6.1 --- a/src/render/software/SDL_blendfillrect.c	Wed Jan 15 22:18:31 2020 -0800
     6.2 +++ b/src/render/software/SDL_blendfillrect.c	Thu Jan 16 08:52:59 2020 -0800
     6.3 @@ -42,6 +42,9 @@
     6.4      case SDL_BLENDMODE_MOD:
     6.5          FILLRECT(Uint16, DRAW_SETPIXEL_MOD_RGB555);
     6.6          break;
     6.7 +    case SDL_BLENDMODE_MUL:
     6.8 +        FILLRECT(Uint16, DRAW_SETPIXEL_MUL_RGB555);
     6.9 +        break;
    6.10      default:
    6.11          FILLRECT(Uint16, DRAW_SETPIXEL_RGB555);
    6.12          break;
    6.13 @@ -65,6 +68,9 @@
    6.14      case SDL_BLENDMODE_MOD:
    6.15          FILLRECT(Uint16, DRAW_SETPIXEL_MOD_RGB565);
    6.16          break;
    6.17 +    case SDL_BLENDMODE_MUL:
    6.18 +        FILLRECT(Uint16, DRAW_SETPIXEL_MUL_RGB565);
    6.19 +        break;
    6.20      default:
    6.21          FILLRECT(Uint16, DRAW_SETPIXEL_RGB565);
    6.22          break;
    6.23 @@ -88,6 +94,9 @@
    6.24      case SDL_BLENDMODE_MOD:
    6.25          FILLRECT(Uint32, DRAW_SETPIXEL_MOD_RGB888);
    6.26          break;
    6.27 +    case SDL_BLENDMODE_MUL:
    6.28 +        FILLRECT(Uint32, DRAW_SETPIXEL_MUL_RGB888);
    6.29 +        break;
    6.30      default:
    6.31          FILLRECT(Uint32, DRAW_SETPIXEL_RGB888);
    6.32          break;
    6.33 @@ -111,6 +120,9 @@
    6.34      case SDL_BLENDMODE_MOD:
    6.35          FILLRECT(Uint32, DRAW_SETPIXEL_MOD_ARGB8888);
    6.36          break;
    6.37 +    case SDL_BLENDMODE_MUL:
    6.38 +        FILLRECT(Uint32, DRAW_SETPIXEL_MUL_ARGB8888);
    6.39 +        break;
    6.40      default:
    6.41          FILLRECT(Uint32, DRAW_SETPIXEL_ARGB8888);
    6.42          break;
    6.43 @@ -137,6 +149,9 @@
    6.44          case SDL_BLENDMODE_MOD:
    6.45              FILLRECT(Uint16, DRAW_SETPIXEL_MOD_RGB);
    6.46              break;
    6.47 +        case SDL_BLENDMODE_MUL:
    6.48 +            FILLRECT(Uint16, DRAW_SETPIXEL_MUL_RGB);
    6.49 +            break;
    6.50          default:
    6.51              FILLRECT(Uint16, DRAW_SETPIXEL_RGB);
    6.52              break;
    6.53 @@ -153,6 +168,9 @@
    6.54          case SDL_BLENDMODE_MOD:
    6.55              FILLRECT(Uint32, DRAW_SETPIXEL_MOD_RGB);
    6.56              break;
    6.57 +        case SDL_BLENDMODE_MUL:
    6.58 +            FILLRECT(Uint32, DRAW_SETPIXEL_MUL_RGB);
    6.59 +            break;
    6.60          default:
    6.61              FILLRECT(Uint32, DRAW_SETPIXEL_RGB);
    6.62              break;
    6.63 @@ -182,6 +200,9 @@
    6.64          case SDL_BLENDMODE_MOD:
    6.65              FILLRECT(Uint32, DRAW_SETPIXEL_MOD_RGBA);
    6.66              break;
    6.67 +        case SDL_BLENDMODE_MUL:
    6.68 +            FILLRECT(Uint32, DRAW_SETPIXEL_MUL_RGBA);
    6.69 +            break;
    6.70          default:
    6.71              FILLRECT(Uint32, DRAW_SETPIXEL_RGBA);
    6.72              break;
     7.1 --- a/src/render/software/SDL_blendline.c	Wed Jan 15 22:18:31 2020 -0800
     7.2 +++ b/src/render/software/SDL_blendline.c	Thu Jan 16 08:52:59 2020 -0800
     7.3 @@ -59,6 +59,9 @@
     7.4          case SDL_BLENDMODE_MOD:
     7.5              HLINE(Uint16, DRAW_SETPIXEL_MOD_RGB, draw_end);
     7.6              break;
     7.7 +        case SDL_BLENDMODE_MUL:
     7.8 +            HLINE(Uint16, DRAW_SETPIXEL_MUL_RGB, draw_end);
     7.9 +            break;
    7.10          default:
    7.11              HLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end);
    7.12              break;
    7.13 @@ -74,6 +77,9 @@
    7.14          case SDL_BLENDMODE_MOD:
    7.15              VLINE(Uint16, DRAW_SETPIXEL_MOD_RGB, draw_end);
    7.16              break;
    7.17 +        case SDL_BLENDMODE_MUL:
    7.18 +            VLINE(Uint16, DRAW_SETPIXEL_MUL_RGB, draw_end);
    7.19 +            break;
    7.20          default:
    7.21              VLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end);
    7.22              break;
    7.23 @@ -89,6 +95,9 @@
    7.24          case SDL_BLENDMODE_MOD:
    7.25              DLINE(Uint16, DRAW_SETPIXEL_MOD_RGB, draw_end);
    7.26              break;
    7.27 +        case SDL_BLENDMODE_MUL:
    7.28 +            DLINE(Uint16, DRAW_SETPIXEL_MUL_RGB, draw_end);
    7.29 +            break;
    7.30          default:
    7.31              DLINE(Uint16, DRAW_SETPIXEL_RGB, draw_end);
    7.32              break;
    7.33 @@ -110,6 +119,11 @@
    7.34                     DRAW_SETPIXELXY2_MOD_RGB, DRAW_SETPIXELXY2_MOD_RGB,
    7.35                     draw_end);
    7.36              break;
    7.37 +        case SDL_BLENDMODE_MUL:
    7.38 +            AALINE(x1, y1, x2, y2,
    7.39 +                   DRAW_SETPIXELXY2_MUL_RGB, DRAW_SETPIXELXY2_MUL_RGB,
    7.40 +                   draw_end);
    7.41 +            break;
    7.42          default:
    7.43              AALINE(x1, y1, x2, y2,
    7.44                     DRAW_SETPIXELXY2_RGB, DRAW_SETPIXELXY2_BLEND_RGB,
    7.45 @@ -150,6 +164,9 @@
    7.46          case SDL_BLENDMODE_MOD:
    7.47              HLINE(Uint16, DRAW_SETPIXEL_MOD_RGB555, draw_end);
    7.48              break;
    7.49 +        case SDL_BLENDMODE_MUL:
    7.50 +            HLINE(Uint16, DRAW_SETPIXEL_MUL_RGB555, draw_end);
    7.51 +            break;
    7.52          default:
    7.53              HLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end);
    7.54              break;
    7.55 @@ -165,6 +182,9 @@
    7.56          case SDL_BLENDMODE_MOD:
    7.57              VLINE(Uint16, DRAW_SETPIXEL_MOD_RGB555, draw_end);
    7.58              break;
    7.59 +        case SDL_BLENDMODE_MUL:
    7.60 +            VLINE(Uint16, DRAW_SETPIXEL_MUL_RGB555, draw_end);
    7.61 +            break;
    7.62          default:
    7.63              VLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end);
    7.64              break;
    7.65 @@ -180,6 +200,9 @@
    7.66          case SDL_BLENDMODE_MOD:
    7.67              DLINE(Uint16, DRAW_SETPIXEL_MOD_RGB555, draw_end);
    7.68              break;
    7.69 +        case SDL_BLENDMODE_MUL:
    7.70 +            DLINE(Uint16, DRAW_SETPIXEL_MUL_RGB555, draw_end);
    7.71 +            break;
    7.72          default:
    7.73              DLINE(Uint16, DRAW_SETPIXEL_RGB555, draw_end);
    7.74              break;
    7.75 @@ -201,6 +224,11 @@
    7.76                     DRAW_SETPIXELXY_MOD_RGB555, DRAW_SETPIXELXY_MOD_RGB555,
    7.77                     draw_end);
    7.78              break;
    7.79 +        case SDL_BLENDMODE_MUL:
    7.80 +            AALINE(x1, y1, x2, y2,
    7.81 +                   DRAW_SETPIXELXY_MUL_RGB555, DRAW_SETPIXELXY_MUL_RGB555,
    7.82 +                   draw_end);
    7.83 +            break;
    7.84          default:
    7.85              AALINE(x1, y1, x2, y2,
    7.86                     DRAW_SETPIXELXY_RGB555, DRAW_SETPIXELXY_BLEND_RGB555,
    7.87 @@ -241,6 +269,9 @@
    7.88          case SDL_BLENDMODE_MOD:
    7.89              HLINE(Uint16, DRAW_SETPIXEL_MOD_RGB565, draw_end);
    7.90              break;
    7.91 +        case SDL_BLENDMODE_MUL:
    7.92 +            HLINE(Uint16, DRAW_SETPIXEL_MUL_RGB565, draw_end);
    7.93 +            break;
    7.94          default:
    7.95              HLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end);
    7.96              break;
    7.97 @@ -256,6 +287,9 @@
    7.98          case SDL_BLENDMODE_MOD:
    7.99              VLINE(Uint16, DRAW_SETPIXEL_MOD_RGB565, draw_end);
   7.100              break;
   7.101 +        case SDL_BLENDMODE_MUL:
   7.102 +            VLINE(Uint16, DRAW_SETPIXEL_MUL_RGB565, draw_end);
   7.103 +            break;
   7.104          default:
   7.105              VLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end);
   7.106              break;
   7.107 @@ -271,6 +305,9 @@
   7.108          case SDL_BLENDMODE_MOD:
   7.109              DLINE(Uint16, DRAW_SETPIXEL_MOD_RGB565, draw_end);
   7.110              break;
   7.111 +        case SDL_BLENDMODE_MUL:
   7.112 +            DLINE(Uint16, DRAW_SETPIXEL_MUL_RGB565, draw_end);
   7.113 +            break;
   7.114          default:
   7.115              DLINE(Uint16, DRAW_SETPIXEL_RGB565, draw_end);
   7.116              break;
   7.117 @@ -292,6 +329,11 @@
   7.118                     DRAW_SETPIXELXY_MOD_RGB565, DRAW_SETPIXELXY_MOD_RGB565,
   7.119                     draw_end);
   7.120              break;
   7.121 +        case SDL_BLENDMODE_MUL:
   7.122 +            AALINE(x1, y1, x2, y2,
   7.123 +                   DRAW_SETPIXELXY_MUL_RGB565, DRAW_SETPIXELXY_MUL_RGB565,
   7.124 +                   draw_end);
   7.125 +            break;
   7.126          default:
   7.127              AALINE(x1, y1, x2, y2,
   7.128                     DRAW_SETPIXELXY_RGB565, DRAW_SETPIXELXY_BLEND_RGB565,
   7.129 @@ -333,6 +375,9 @@
   7.130          case SDL_BLENDMODE_MOD:
   7.131              HLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end);
   7.132              break;
   7.133 +        case SDL_BLENDMODE_MUL:
   7.134 +            HLINE(Uint32, DRAW_SETPIXEL_MUL_RGB, draw_end);
   7.135 +            break;
   7.136          default:
   7.137              HLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end);
   7.138              break;
   7.139 @@ -348,6 +393,9 @@
   7.140          case SDL_BLENDMODE_MOD:
   7.141              VLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end);
   7.142              break;
   7.143 +        case SDL_BLENDMODE_MUL:
   7.144 +            VLINE(Uint32, DRAW_SETPIXEL_MUL_RGB, draw_end);
   7.145 +            break;
   7.146          default:
   7.147              VLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end);
   7.148              break;
   7.149 @@ -363,6 +411,9 @@
   7.150          case SDL_BLENDMODE_MOD:
   7.151              DLINE(Uint32, DRAW_SETPIXEL_MOD_RGB, draw_end);
   7.152              break;
   7.153 +        case SDL_BLENDMODE_MUL:
   7.154 +            DLINE(Uint32, DRAW_SETPIXEL_MUL_RGB, draw_end);
   7.155 +            break;
   7.156          default:
   7.157              DLINE(Uint32, DRAW_SETPIXEL_RGB, draw_end);
   7.158              break;
   7.159 @@ -384,6 +435,11 @@
   7.160                     DRAW_SETPIXELXY4_MOD_RGB, DRAW_SETPIXELXY4_MOD_RGB,
   7.161                     draw_end);
   7.162              break;
   7.163 +        case SDL_BLENDMODE_MUL:
   7.164 +            AALINE(x1, y1, x2, y2,
   7.165 +                   DRAW_SETPIXELXY4_MUL_RGB, DRAW_SETPIXELXY4_MUL_RGB,
   7.166 +                   draw_end);
   7.167 +            break;
   7.168          default:
   7.169              AALINE(x1, y1, x2, y2,
   7.170                     DRAW_SETPIXELXY4_RGB, DRAW_SETPIXELXY4_BLEND_RGB,
   7.171 @@ -425,6 +481,9 @@
   7.172          case SDL_BLENDMODE_MOD:
   7.173              HLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end);
   7.174              break;
   7.175 +        case SDL_BLENDMODE_MUL:
   7.176 +            HLINE(Uint32, DRAW_SETPIXEL_MUL_RGBA, draw_end);
   7.177 +            break;
   7.178          default:
   7.179              HLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end);
   7.180              break;
   7.181 @@ -440,6 +499,9 @@
   7.182          case SDL_BLENDMODE_MOD:
   7.183              VLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end);
   7.184              break;
   7.185 +        case SDL_BLENDMODE_MUL:
   7.186 +            VLINE(Uint32, DRAW_SETPIXEL_MUL_RGBA, draw_end);
   7.187 +            break;
   7.188          default:
   7.189              VLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end);
   7.190              break;
   7.191 @@ -455,6 +517,9 @@
   7.192          case SDL_BLENDMODE_MOD:
   7.193              DLINE(Uint32, DRAW_SETPIXEL_MOD_RGBA, draw_end);
   7.194              break;
   7.195 +        case SDL_BLENDMODE_MUL:
   7.196 +            DLINE(Uint32, DRAW_SETPIXEL_MUL_RGBA, draw_end);
   7.197 +            break;
   7.198          default:
   7.199              DLINE(Uint32, DRAW_SETPIXEL_RGBA, draw_end);
   7.200              break;
   7.201 @@ -476,6 +541,11 @@
   7.202                     DRAW_SETPIXELXY4_MOD_RGBA, DRAW_SETPIXELXY4_MOD_RGBA,
   7.203                     draw_end);
   7.204              break;
   7.205 +        case SDL_BLENDMODE_MUL:
   7.206 +            AALINE(x1, y1, x2, y2,
   7.207 +                   DRAW_SETPIXELXY4_MUL_RGBA, DRAW_SETPIXELXY4_MUL_RGBA,
   7.208 +                   draw_end);
   7.209 +            break;
   7.210          default:
   7.211              AALINE(x1, y1, x2, y2,
   7.212                     DRAW_SETPIXELXY4_RGBA, DRAW_SETPIXELXY4_BLEND_RGBA,
   7.213 @@ -516,6 +586,9 @@
   7.214          case SDL_BLENDMODE_MOD:
   7.215              HLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end);
   7.216              break;
   7.217 +        case SDL_BLENDMODE_MUL:
   7.218 +            HLINE(Uint32, DRAW_SETPIXEL_MUL_RGB888, draw_end);
   7.219 +            break;
   7.220          default:
   7.221              HLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
   7.222              break;
   7.223 @@ -531,6 +604,9 @@
   7.224          case SDL_BLENDMODE_MOD:
   7.225              VLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end);
   7.226              break;
   7.227 +        case SDL_BLENDMODE_MUL:
   7.228 +            VLINE(Uint32, DRAW_SETPIXEL_MUL_RGB888, draw_end);
   7.229 +            break;
   7.230          default:
   7.231              VLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
   7.232              break;
   7.233 @@ -546,6 +622,9 @@
   7.234          case SDL_BLENDMODE_MOD:
   7.235              DLINE(Uint32, DRAW_SETPIXEL_MOD_RGB888, draw_end);
   7.236              break;
   7.237 +        case SDL_BLENDMODE_MUL:
   7.238 +            DLINE(Uint32, DRAW_SETPIXEL_MUL_RGB888, draw_end);
   7.239 +            break;
   7.240          default:
   7.241              DLINE(Uint32, DRAW_SETPIXEL_RGB888, draw_end);
   7.242              break;
   7.243 @@ -567,6 +646,11 @@
   7.244                     DRAW_SETPIXELXY_MOD_RGB888, DRAW_SETPIXELXY_MOD_RGB888,
   7.245                     draw_end);
   7.246              break;
   7.247 +        case SDL_BLENDMODE_MUL:
   7.248 +            AALINE(x1, y1, x2, y2,
   7.249 +                   DRAW_SETPIXELXY_MUL_RGB888, DRAW_SETPIXELXY_MUL_RGB888,
   7.250 +                   draw_end);
   7.251 +            break;
   7.252          default:
   7.253              AALINE(x1, y1, x2, y2,
   7.254                     DRAW_SETPIXELXY_RGB888, DRAW_SETPIXELXY_BLEND_RGB888,
   7.255 @@ -607,6 +691,9 @@
   7.256          case SDL_BLENDMODE_MOD:
   7.257              HLINE(Uint32, DRAW_SETPIXEL_MOD_ARGB8888, draw_end);
   7.258              break;
   7.259 +        case SDL_BLENDMODE_MUL:
   7.260 +            HLINE(Uint32, DRAW_SETPIXEL_MUL_ARGB8888, draw_end);
   7.261 +            break;
   7.262          default:
   7.263              HLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end);
   7.264              break;
   7.265 @@ -622,6 +709,9 @@
   7.266          case SDL_BLENDMODE_MOD:
   7.267              VLINE(Uint32, DRAW_SETPIXEL_MOD_ARGB8888, draw_end);
   7.268              break;
   7.269 +        case SDL_BLENDMODE_MUL:
   7.270 +            VLINE(Uint32, DRAW_SETPIXEL_MUL_ARGB8888, draw_end);
   7.271 +            break;
   7.272          default:
   7.273              VLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end);
   7.274              break;
   7.275 @@ -637,6 +727,9 @@
   7.276          case SDL_BLENDMODE_MOD:
   7.277              DLINE(Uint32, DRAW_SETPIXEL_MOD_ARGB8888, draw_end);
   7.278              break;
   7.279 +        case SDL_BLENDMODE_MUL:
   7.280 +            DLINE(Uint32, DRAW_SETPIXEL_MUL_ARGB8888, draw_end);
   7.281 +            break;
   7.282          default:
   7.283              DLINE(Uint32, DRAW_SETPIXEL_ARGB8888, draw_end);
   7.284              break;
   7.285 @@ -658,6 +751,11 @@
   7.286                     DRAW_SETPIXELXY_MOD_ARGB8888, DRAW_SETPIXELXY_MOD_ARGB8888,
   7.287                     draw_end);
   7.288              break;
   7.289 +        case SDL_BLENDMODE_MUL:
   7.290 +            AALINE(x1, y1, x2, y2,
   7.291 +                   DRAW_SETPIXELXY_MUL_ARGB8888, DRAW_SETPIXELXY_MUL_ARGB8888,
   7.292 +                   draw_end);
   7.293 +            break;
   7.294          default:
   7.295              AALINE(x1, y1, x2, y2,
   7.296                     DRAW_SETPIXELXY_ARGB8888, DRAW_SETPIXELXY_BLEND_ARGB8888,
     8.1 --- a/src/render/software/SDL_blendpoint.c	Wed Jan 15 22:18:31 2020 -0800
     8.2 +++ b/src/render/software/SDL_blendpoint.c	Thu Jan 16 08:52:59 2020 -0800
     8.3 @@ -42,6 +42,9 @@
     8.4      case SDL_BLENDMODE_MOD:
     8.5          DRAW_SETPIXELXY_MOD_RGB555(x, y);
     8.6          break;
     8.7 +    case SDL_BLENDMODE_MUL:
     8.8 +        DRAW_SETPIXELXY_MUL_RGB555(x, y);
     8.9 +        break;
    8.10      default:
    8.11          DRAW_SETPIXELXY_RGB555(x, y);
    8.12          break;
    8.13 @@ -65,6 +68,9 @@
    8.14      case SDL_BLENDMODE_MOD:
    8.15          DRAW_SETPIXELXY_MOD_RGB565(x, y);
    8.16          break;
    8.17 +    case SDL_BLENDMODE_MUL:
    8.18 +        DRAW_SETPIXELXY_MUL_RGB565(x, y);
    8.19 +        break;
    8.20      default:
    8.21          DRAW_SETPIXELXY_RGB565(x, y);
    8.22          break;
    8.23 @@ -88,6 +94,9 @@
    8.24      case SDL_BLENDMODE_MOD:
    8.25          DRAW_SETPIXELXY_MOD_RGB888(x, y);
    8.26          break;
    8.27 +    case SDL_BLENDMODE_MUL:
    8.28 +        DRAW_SETPIXELXY_MUL_RGB888(x, y);
    8.29 +        break;
    8.30      default:
    8.31          DRAW_SETPIXELXY_RGB888(x, y);
    8.32          break;
    8.33 @@ -111,6 +120,9 @@
    8.34      case SDL_BLENDMODE_MOD:
    8.35          DRAW_SETPIXELXY_MOD_ARGB8888(x, y);
    8.36          break;
    8.37 +    case SDL_BLENDMODE_MUL:
    8.38 +        DRAW_SETPIXELXY_MUL_ARGB8888(x, y);
    8.39 +        break;
    8.40      default:
    8.41          DRAW_SETPIXELXY_ARGB8888(x, y);
    8.42          break;
    8.43 @@ -137,6 +149,9 @@
    8.44          case SDL_BLENDMODE_MOD:
    8.45              DRAW_SETPIXELXY2_MOD_RGB(x, y);
    8.46              break;
    8.47 +        case SDL_BLENDMODE_MUL:
    8.48 +            DRAW_SETPIXELXY2_MUL_RGB(x, y);
    8.49 +            break;
    8.50          default:
    8.51              DRAW_SETPIXELXY2_RGB(x, y);
    8.52              break;
    8.53 @@ -153,6 +168,9 @@
    8.54          case SDL_BLENDMODE_MOD:
    8.55              DRAW_SETPIXELXY4_MOD_RGB(x, y);
    8.56              break;
    8.57 +        case SDL_BLENDMODE_MUL:
    8.58 +            DRAW_SETPIXELXY4_MUL_RGB(x, y);
    8.59 +            break;
    8.60          default:
    8.61              DRAW_SETPIXELXY4_RGB(x, y);
    8.62              break;
    8.63 @@ -182,6 +200,9 @@
    8.64          case SDL_BLENDMODE_MOD:
    8.65              DRAW_SETPIXELXY4_MOD_RGBA(x, y);
    8.66              break;
    8.67 +        case SDL_BLENDMODE_MUL:
    8.68 +            DRAW_SETPIXELXY4_MUL_RGBA(x, y);
    8.69 +            break;
    8.70          default:
    8.71              DRAW_SETPIXELXY4_RGBA(x, y);
    8.72              break;
     9.1 --- a/src/render/software/SDL_draw.h	Wed Jan 15 22:18:31 2020 -0800
     9.2 +++ b/src/render/software/SDL_draw.h	Thu Jan 16 08:52:59 2020 -0800
     9.3 @@ -80,6 +80,17 @@
     9.4      setpixel; \
     9.5  } while (0)
     9.6  
     9.7 +#define DRAW_SETPIXEL_MUL(getpixel, setpixel) \
     9.8 +do { \
     9.9 +    unsigned sr, sg, sb, sa; sa = 0xFF; \
    9.10 +    getpixel; \
    9.11 +    sr = DRAW_MUL(sr, r) + DRAW_MUL(inva, sr); if (sr > 0xff) sr = 0xff; \
    9.12 +    sg = DRAW_MUL(sg, g) + DRAW_MUL(inva, sg); if (sg > 0xff) sg = 0xff; \
    9.13 +    sb = DRAW_MUL(sb, b) + DRAW_MUL(inva, sb); if (sb > 0xff) sb = 0xff; \
    9.14 +    sa = DRAW_MUL(sa, a) + DRAW_MUL(inva, sa); if (sa > 0xff) sa = 0xff; \
    9.15 +    setpixel; \
    9.16 +} while (0)
    9.17 +
    9.18  #define DRAW_SETPIXELXY(x, y, type, bpp, op) \
    9.19  do { \
    9.20      type *pixel = (type *)((Uint8 *)dst->pixels + (y) * dst->pitch \
    9.21 @@ -106,6 +117,10 @@
    9.22      DRAW_SETPIXEL_MOD(RGB_FROM_RGB555(*pixel, sr, sg, sb), \
    9.23                        RGB555_FROM_RGB(*pixel, sr, sg, sb))
    9.24  
    9.25 +#define DRAW_SETPIXEL_MUL_RGB555 \
    9.26 +    DRAW_SETPIXEL_MUL(RGB_FROM_RGB555(*pixel, sr, sg, sb), \
    9.27 +                      RGB555_FROM_RGB(*pixel, sr, sg, sb))
    9.28 +
    9.29  #define DRAW_SETPIXELXY_RGB555(x, y) \
    9.30      DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_RGB555)
    9.31  
    9.32 @@ -118,6 +133,9 @@
    9.33  #define DRAW_SETPIXELXY_MOD_RGB555(x, y) \
    9.34      DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MOD_RGB555)
    9.35  
    9.36 +#define DRAW_SETPIXELXY_MUL_RGB555(x, y) \
    9.37 +    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MUL_RGB555)
    9.38 +
    9.39  /*
    9.40   * Define draw operators for RGB565
    9.41   */
    9.42 @@ -137,6 +155,10 @@
    9.43      DRAW_SETPIXEL_MOD(RGB_FROM_RGB565(*pixel, sr, sg, sb), \
    9.44                        RGB565_FROM_RGB(*pixel, sr, sg, sb))
    9.45  
    9.46 +#define DRAW_SETPIXEL_MUL_RGB565 \
    9.47 +    DRAW_SETPIXEL_MUL(RGB_FROM_RGB565(*pixel, sr, sg, sb), \
    9.48 +                      RGB565_FROM_RGB(*pixel, sr, sg, sb))
    9.49 +
    9.50  #define DRAW_SETPIXELXY_RGB565(x, y) \
    9.51      DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_RGB565)
    9.52  
    9.53 @@ -149,6 +171,9 @@
    9.54  #define DRAW_SETPIXELXY_MOD_RGB565(x, y) \
    9.55      DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MOD_RGB565)
    9.56  
    9.57 +#define DRAW_SETPIXELXY_MUL_RGB565(x, y) \
    9.58 +    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MUL_RGB565)
    9.59 +
    9.60  /*
    9.61   * Define draw operators for RGB888
    9.62   */
    9.63 @@ -168,6 +193,10 @@
    9.64      DRAW_SETPIXEL_MOD(RGB_FROM_RGB888(*pixel, sr, sg, sb), \
    9.65                        RGB888_FROM_RGB(*pixel, sr, sg, sb))
    9.66  
    9.67 +#define DRAW_SETPIXEL_MUL_RGB888 \
    9.68 +    DRAW_SETPIXEL_MUL(RGB_FROM_RGB888(*pixel, sr, sg, sb), \
    9.69 +                      RGB888_FROM_RGB(*pixel, sr, sg, sb))
    9.70 +
    9.71  #define DRAW_SETPIXELXY_RGB888(x, y) \
    9.72      DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_RGB888)
    9.73  
    9.74 @@ -180,6 +209,9 @@
    9.75  #define DRAW_SETPIXELXY_MOD_RGB888(x, y) \
    9.76      DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_RGB888)
    9.77  
    9.78 +#define DRAW_SETPIXELXY_MUL_RGB888(x, y) \
    9.79 +    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MUL_RGB888)
    9.80 +
    9.81  /*
    9.82   * Define draw operators for ARGB8888
    9.83   */
    9.84 @@ -199,6 +231,10 @@
    9.85      DRAW_SETPIXEL_MOD(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \
    9.86                        ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa))
    9.87  
    9.88 +#define DRAW_SETPIXEL_MUL_ARGB8888 \
    9.89 +    DRAW_SETPIXEL_MUL(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \
    9.90 +                      ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa))
    9.91 +
    9.92  #define DRAW_SETPIXELXY_ARGB8888(x, y) \
    9.93      DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ARGB8888)
    9.94  
    9.95 @@ -211,6 +247,9 @@
    9.96  #define DRAW_SETPIXELXY_MOD_ARGB8888(x, y) \
    9.97      DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_ARGB8888)
    9.98  
    9.99 +#define DRAW_SETPIXELXY_MUL_ARGB8888(x, y) \
   9.100 +    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MUL_ARGB8888)
   9.101 +
   9.102  /*
   9.103   * Define draw operators for general RGB
   9.104   */
   9.105 @@ -230,6 +269,10 @@
   9.106      DRAW_SETPIXEL_MOD(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \
   9.107                        PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb))
   9.108  
   9.109 +#define DRAW_SETPIXEL_MUL_RGB \
   9.110 +    DRAW_SETPIXEL_MUL(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \
   9.111 +                      PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb))
   9.112 +
   9.113  #define DRAW_SETPIXELXY2_RGB(x, y) \
   9.114      DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_RGB)
   9.115  
   9.116 @@ -254,6 +297,12 @@
   9.117  #define DRAW_SETPIXELXY4_MOD_RGB(x, y) \
   9.118      DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_RGB)
   9.119  
   9.120 +#define DRAW_SETPIXELXY2_MUL_RGB(x, y) \
   9.121 +    DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_MUL_RGB)
   9.122 +
   9.123 +#define DRAW_SETPIXELXY4_MUL_RGB(x, y) \
   9.124 +    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MUL_RGB)
   9.125 +
   9.126  
   9.127  /*
   9.128   * Define draw operators for general RGBA
   9.129 @@ -274,6 +323,10 @@
   9.130      DRAW_SETPIXEL_MOD(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \
   9.131                        PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa))
   9.132  
   9.133 +#define DRAW_SETPIXEL_MUL_RGBA \
   9.134 +    DRAW_SETPIXEL_MUL(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \
   9.135 +                      PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa))
   9.136 +
   9.137  #define DRAW_SETPIXELXY4_RGBA(x, y) \
   9.138      DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_RGBA)
   9.139  
   9.140 @@ -286,6 +339,9 @@
   9.141  #define DRAW_SETPIXELXY4_MOD_RGBA(x, y) \
   9.142      DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MOD_RGBA)
   9.143  
   9.144 +#define DRAW_SETPIXELXY4_MUL_RGBA(x, y) \
   9.145 +    DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_MUL_RGBA)
   9.146 +
   9.147  /*
   9.148   * Define line drawing macro
   9.149   */
    10.1 --- a/src/render/software/SDL_render_sw.c	Wed Jan 15 22:18:31 2020 -0800
    10.2 +++ b/src/render/software/SDL_render_sw.c	Thu Jan 16 08:52:59 2020 -0800
    10.3 @@ -399,8 +399,8 @@
    10.4          blitRequired = SDL_TRUE;
    10.5      }
    10.6  
    10.7 -    /* The color and alpha modulation has to be applied before the rotation when using the NONE and MOD blend modes. */
    10.8 -    if ((blendmode == SDL_BLENDMODE_NONE || blendmode == SDL_BLENDMODE_MOD) && (alphaMod & rMod & gMod & bMod) != 255) {
    10.9 +    /* The color and alpha modulation has to be applied before the rotation when using the NONE, MOD or MUL blend modes. */
   10.10 +    if ((blendmode == SDL_BLENDMODE_NONE || blendmode == SDL_BLENDMODE_MOD || blendmode == SDL_BLENDMODE_MUL) && (alphaMod & rMod & gMod & bMod) != 255) {
   10.11          applyModulation = SDL_TRUE;
   10.12          SDL_SetSurfaceAlphaMod(src_clone, alphaMod);
   10.13          SDL_SetSurfaceColorMod(src_clone, rMod, gMod, bMod);
   10.14 @@ -573,7 +573,7 @@
   10.15      SDL_Surface *surface = (SDL_Surface *) texture->driverdata;
   10.16      const SDL_bool colormod = ((r & g & b) != 0xFF);
   10.17      const SDL_bool alphamod = (a != 0xFF);
   10.18 -    const SDL_bool blending = ((blend == SDL_BLENDMODE_ADD) || (blend == SDL_BLENDMODE_MOD));
   10.19 +    const SDL_bool blending = ((blend == SDL_BLENDMODE_ADD) || (blend == SDL_BLENDMODE_MOD) || (blend == SDL_BLENDMODE_MUL));
   10.20  
   10.21      if (colormod || alphamod || blending) {
   10.22          SDL_SetSurfaceRLE(surface, 0);
    11.1 --- a/src/render/software/SDL_rotate.c	Wed Jan 15 22:18:31 2020 -0800
    11.2 +++ b/src/render/software/SDL_rotate.c	Thu Jan 16 08:52:59 2020 -0800
    11.3 @@ -474,8 +474,8 @@
    11.4          SDL_FillRect(rz_dst, NULL, colorkey);
    11.5      } else if (blendmode == SDL_BLENDMODE_NONE) {
    11.6          blendmode = SDL_BLENDMODE_BLEND;
    11.7 -    } else if (blendmode == SDL_BLENDMODE_MOD) {
    11.8 -        /* Without a colorkey, the target texture has to be white for the MOD blend mode so
    11.9 +    } else if (blendmode == SDL_BLENDMODE_MOD || blendmode == SDL_BLENDMODE_MUL) {
   11.10 +        /* Without a colorkey, the target texture has to be white for the MOD and MUL blend mode so
   11.11           * that the pixels outside the rotated area don't affect the destination surface.
   11.12           */
   11.13          colorkey = SDL_MapRGBA(rz_dst->format, 255, 255, 255, 0);
    12.1 --- a/src/video/SDL_RLEaccel.c	Wed Jan 15 22:18:31 2020 -0800
    12.2 +++ b/src/video/SDL_RLEaccel.c	Thu Jan 16 08:52:59 2020 -0800
    12.3 @@ -1430,7 +1430,7 @@
    12.4      /* Pass on combinations not supported */
    12.5      if ((flags & SDL_COPY_MODULATE_COLOR) ||
    12.6          ((flags & SDL_COPY_MODULATE_ALPHA) && surface->format->Amask) ||
    12.7 -        (flags & (SDL_COPY_ADD | SDL_COPY_MOD)) ||
    12.8 +        (flags & (SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL)) ||
    12.9          (flags & SDL_COPY_NEAREST)) {
   12.10          return -1;
   12.11      }
    13.1 --- a/src/video/SDL_blit.c	Wed Jan 15 22:18:31 2020 -0800
    13.2 +++ b/src/video/SDL_blit.c	Thu Jan 16 08:52:59 2020 -0800
    13.3 @@ -182,7 +182,7 @@
    13.4          /* Check blend flags */
    13.5          flagcheck =
    13.6              (flags &
    13.7 -             (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD));
    13.8 +             (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL));
    13.9          if ((flagcheck & entries[i].flags) != flagcheck) {
   13.10              continue;
   13.11          }
    14.1 --- a/src/video/SDL_blit.h	Wed Jan 15 22:18:31 2020 -0800
    14.2 +++ b/src/video/SDL_blit.h	Thu Jan 16 08:52:59 2020 -0800
    14.3 @@ -36,6 +36,7 @@
    14.4  #define SDL_COPY_BLEND              0x00000010
    14.5  #define SDL_COPY_ADD                0x00000020
    14.6  #define SDL_COPY_MOD                0x00000040
    14.7 +#define SDL_COPY_MUL                0x00000080
    14.8  #define SDL_COPY_COLORKEY           0x00000100
    14.9  #define SDL_COPY_NEAREST            0x00000200
   14.10  #define SDL_COPY_RLE_DESIRED        0x00001000
    15.1 --- a/src/video/SDL_blit_auto.c	Wed Jan 15 22:18:31 2020 -0800
    15.2 +++ b/src/video/SDL_blit_auto.c	Thu Jan 16 08:52:59 2020 -0800
    15.3 @@ -82,7 +82,7 @@
    15.4              srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
    15.5              dstpixel = *dst;
    15.6              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
    15.7 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
    15.8 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
    15.9              case SDL_COPY_BLEND:
   15.10                  dstR = srcR;
   15.11                  dstG = srcG;
   15.12 @@ -98,6 +98,11 @@
   15.13                  dstG = (srcG * dstG) / 255;
   15.14                  dstB = (srcB * dstB) / 255;
   15.15                  break;
   15.16 +            case SDL_COPY_MUL:
   15.17 +                dstR = (srcR * dstR) / 255;
   15.18 +                dstG = (srcG * dstG) / 255;
   15.19 +                dstB = (srcB * dstB) / 255;
   15.20 +                break;
   15.21              }
   15.22              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
   15.23              *dst = dstpixel;
   15.24 @@ -147,7 +152,7 @@
   15.25              srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   15.26              dstpixel = *dst;
   15.27              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
   15.28 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
   15.29 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
   15.30              case SDL_COPY_BLEND:
   15.31                  dstR = srcR;
   15.32                  dstG = srcG;
   15.33 @@ -163,6 +168,11 @@
   15.34                  dstG = (srcG * dstG) / 255;
   15.35                  dstB = (srcB * dstB) / 255;
   15.36                  break;
   15.37 +            case SDL_COPY_MUL:
   15.38 +                dstR = (srcR * dstR) / 255;
   15.39 +                dstG = (srcG * dstG) / 255;
   15.40 +                dstB = (srcB * dstB) / 255;
   15.41 +                break;
   15.42              }
   15.43              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
   15.44              *dst = dstpixel;
   15.45 @@ -292,7 +302,7 @@
   15.46                      srcB = (srcB * srcA) / 255;
   15.47                  }
   15.48              }
   15.49 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
   15.50 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
   15.51              case SDL_COPY_BLEND:
   15.52                  dstR = srcR + ((255 - srcA) * dstR) / 255;
   15.53                  dstG = srcG + ((255 - srcA) * dstG) / 255;
   15.54 @@ -308,6 +318,11 @@
   15.55                  dstG = (srcG * dstG) / 255;
   15.56                  dstB = (srcB * dstB) / 255;
   15.57                  break;
   15.58 +            case SDL_COPY_MUL:
   15.59 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
   15.60 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
   15.61 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
   15.62 +                break;
   15.63              }
   15.64              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
   15.65              *dst = dstpixel;
   15.66 @@ -375,7 +390,7 @@
   15.67                      srcB = (srcB * srcA) / 255;
   15.68                  }
   15.69              }
   15.70 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
   15.71 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
   15.72              case SDL_COPY_BLEND:
   15.73                  dstR = srcR + ((255 - srcA) * dstR) / 255;
   15.74                  dstG = srcG + ((255 - srcA) * dstG) / 255;
   15.75 @@ -391,6 +406,11 @@
   15.76                  dstG = (srcG * dstG) / 255;
   15.77                  dstB = (srcB * dstB) / 255;
   15.78                  break;
   15.79 +            case SDL_COPY_MUL:
   15.80 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
   15.81 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
   15.82 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
   15.83 +                break;
   15.84              }
   15.85              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
   15.86              *dst = dstpixel;
   15.87 @@ -462,7 +482,7 @@
   15.88              srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
   15.89              dstpixel = *dst;
   15.90              dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
   15.91 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
   15.92 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
   15.93              case SDL_COPY_BLEND:
   15.94                  dstR = srcR;
   15.95                  dstG = srcG;
   15.96 @@ -478,6 +498,11 @@
   15.97                  dstG = (srcG * dstG) / 255;
   15.98                  dstB = (srcB * dstB) / 255;
   15.99                  break;
  15.100 +            case SDL_COPY_MUL:
  15.101 +                dstR = (srcR * dstR) / 255;
  15.102 +                dstG = (srcG * dstG) / 255;
  15.103 +                dstB = (srcB * dstB) / 255;
  15.104 +                break;
  15.105              }
  15.106              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.107              *dst = dstpixel;
  15.108 @@ -527,7 +552,7 @@
  15.109              srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
  15.110              dstpixel = *dst;
  15.111              dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
  15.112 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.113 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.114              case SDL_COPY_BLEND:
  15.115                  dstR = srcR;
  15.116                  dstG = srcG;
  15.117 @@ -543,6 +568,11 @@
  15.118                  dstG = (srcG * dstG) / 255;
  15.119                  dstB = (srcB * dstB) / 255;
  15.120                  break;
  15.121 +            case SDL_COPY_MUL:
  15.122 +                dstR = (srcR * dstR) / 255;
  15.123 +                dstG = (srcG * dstG) / 255;
  15.124 +                dstB = (srcB * dstB) / 255;
  15.125 +                break;
  15.126              }
  15.127              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.128              *dst = dstpixel;
  15.129 @@ -672,7 +702,7 @@
  15.130                      srcB = (srcB * srcA) / 255;
  15.131                  }
  15.132              }
  15.133 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.134 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.135              case SDL_COPY_BLEND:
  15.136                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.137                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.138 @@ -688,6 +718,11 @@
  15.139                  dstG = (srcG * dstG) / 255;
  15.140                  dstB = (srcB * dstB) / 255;
  15.141                  break;
  15.142 +            case SDL_COPY_MUL:
  15.143 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.144 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.145 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.146 +                break;
  15.147              }
  15.148              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.149              *dst = dstpixel;
  15.150 @@ -755,7 +790,7 @@
  15.151                      srcB = (srcB * srcA) / 255;
  15.152                  }
  15.153              }
  15.154 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.155 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.156              case SDL_COPY_BLEND:
  15.157                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.158                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.159 @@ -771,6 +806,11 @@
  15.160                  dstG = (srcG * dstG) / 255;
  15.161                  dstB = (srcB * dstB) / 255;
  15.162                  break;
  15.163 +            case SDL_COPY_MUL:
  15.164 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.165 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.166 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.167 +                break;
  15.168              }
  15.169              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.170              *dst = dstpixel;
  15.171 @@ -843,7 +883,7 @@
  15.172              srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
  15.173              dstpixel = *dst;
  15.174              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  15.175 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.176 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.177              case SDL_COPY_BLEND:
  15.178                  dstR = srcR;
  15.179                  dstG = srcG;
  15.180 @@ -860,6 +900,12 @@
  15.181                  dstG = (srcG * dstG) / 255;
  15.182                  dstB = (srcB * dstB) / 255;
  15.183                  break;
  15.184 +            case SDL_COPY_MUL:
  15.185 +                dstR = (srcR * dstR) / 255;
  15.186 +                dstG = (srcG * dstG) / 255;
  15.187 +                dstB = (srcB * dstB) / 255;
  15.188 +                dstA = 0xFF;
  15.189 +                break;
  15.190              }
  15.191              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.192              *dst = dstpixel;
  15.193 @@ -909,7 +955,7 @@
  15.194              srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel;
  15.195              dstpixel = *dst;
  15.196              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  15.197 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.198 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.199              case SDL_COPY_BLEND:
  15.200                  dstR = srcR;
  15.201                  dstG = srcG;
  15.202 @@ -926,6 +972,12 @@
  15.203                  dstG = (srcG * dstG) / 255;
  15.204                  dstB = (srcB * dstB) / 255;
  15.205                  break;
  15.206 +            case SDL_COPY_MUL:
  15.207 +                dstR = (srcR * dstR) / 255;
  15.208 +                dstG = (srcG * dstG) / 255;
  15.209 +                dstB = (srcB * dstB) / 255;
  15.210 +                dstA = 0xFF;
  15.211 +                break;
  15.212              }
  15.213              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.214              *dst = dstpixel;
  15.215 @@ -1059,7 +1111,7 @@
  15.216                      srcB = (srcB * srcA) / 255;
  15.217                  }
  15.218              }
  15.219 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.220 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.221              case SDL_COPY_BLEND:
  15.222                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.223                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.224 @@ -1076,6 +1128,12 @@
  15.225                  dstG = (srcG * dstG) / 255;
  15.226                  dstB = (srcB * dstB) / 255;
  15.227                  break;
  15.228 +            case SDL_COPY_MUL:
  15.229 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.230 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.231 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.232 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
  15.233 +                break;
  15.234              }
  15.235              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.236              *dst = dstpixel;
  15.237 @@ -1143,7 +1201,7 @@
  15.238                      srcB = (srcB * srcA) / 255;
  15.239                  }
  15.240              }
  15.241 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.242 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.243              case SDL_COPY_BLEND:
  15.244                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.245                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.246 @@ -1160,6 +1218,12 @@
  15.247                  dstG = (srcG * dstG) / 255;
  15.248                  dstB = (srcB * dstB) / 255;
  15.249                  break;
  15.250 +            case SDL_COPY_MUL:
  15.251 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.252 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.253 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.254 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
  15.255 +                break;
  15.256              }
  15.257              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.258              *dst = dstpixel;
  15.259 @@ -1231,7 +1295,7 @@
  15.260              srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  15.261              dstpixel = *dst;
  15.262              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  15.263 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.264 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.265              case SDL_COPY_BLEND:
  15.266                  dstR = srcR;
  15.267                  dstG = srcG;
  15.268 @@ -1247,6 +1311,11 @@
  15.269                  dstG = (srcG * dstG) / 255;
  15.270                  dstB = (srcB * dstB) / 255;
  15.271                  break;
  15.272 +            case SDL_COPY_MUL:
  15.273 +                dstR = (srcR * dstR) / 255;
  15.274 +                dstG = (srcG * dstG) / 255;
  15.275 +                dstB = (srcB * dstB) / 255;
  15.276 +                break;
  15.277              }
  15.278              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
  15.279              *dst = dstpixel;
  15.280 @@ -1296,7 +1365,7 @@
  15.281              srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  15.282              dstpixel = *dst;
  15.283              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
  15.284 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.285 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.286              case SDL_COPY_BLEND:
  15.287                  dstR = srcR;
  15.288                  dstG = srcG;
  15.289 @@ -1312,6 +1381,11 @@
  15.290                  dstG = (srcG * dstG) / 255;
  15.291                  dstB = (srcB * dstB) / 255;
  15.292                  break;
  15.293 +            case SDL_COPY_MUL:
  15.294 +                dstR = (srcR * dstR) / 255;
  15.295 +                dstG = (srcG * dstG) / 255;
  15.296 +                dstB = (srcB * dstB) / 255;
  15.297 +                break;
  15.298              }
  15.299              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
  15.300              *dst = dstpixel;
  15.301 @@ -1441,7 +1515,7 @@
  15.302                      srcB = (srcB * srcA) / 255;
  15.303                  }
  15.304              }
  15.305 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.306 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.307              case SDL_COPY_BLEND:
  15.308                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.309                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.310 @@ -1457,6 +1531,11 @@
  15.311                  dstG = (srcG * dstG) / 255;
  15.312                  dstB = (srcB * dstB) / 255;
  15.313                  break;
  15.314 +            case SDL_COPY_MUL:
  15.315 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.316 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.317 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.318 +                break;
  15.319              }
  15.320              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
  15.321              *dst = dstpixel;
  15.322 @@ -1524,7 +1603,7 @@
  15.323                      srcB = (srcB * srcA) / 255;
  15.324                  }
  15.325              }
  15.326 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.327 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.328              case SDL_COPY_BLEND:
  15.329                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.330                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.331 @@ -1540,6 +1619,11 @@
  15.332                  dstG = (srcG * dstG) / 255;
  15.333                  dstB = (srcB * dstB) / 255;
  15.334                  break;
  15.335 +            case SDL_COPY_MUL:
  15.336 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.337 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.338 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.339 +                break;
  15.340              }
  15.341              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
  15.342              *dst = dstpixel;
  15.343 @@ -1606,7 +1690,7 @@
  15.344              srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  15.345              dstpixel = *dst;
  15.346              dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
  15.347 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.348 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.349              case SDL_COPY_BLEND:
  15.350                  dstR = srcR;
  15.351                  dstG = srcG;
  15.352 @@ -1622,6 +1706,11 @@
  15.353                  dstG = (srcG * dstG) / 255;
  15.354                  dstB = (srcB * dstB) / 255;
  15.355                  break;
  15.356 +            case SDL_COPY_MUL:
  15.357 +                dstR = (srcR * dstR) / 255;
  15.358 +                dstG = (srcG * dstG) / 255;
  15.359 +                dstB = (srcB * dstB) / 255;
  15.360 +                break;
  15.361              }
  15.362              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.363              *dst = dstpixel;
  15.364 @@ -1671,7 +1760,7 @@
  15.365              srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  15.366              dstpixel = *dst;
  15.367              dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
  15.368 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.369 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.370              case SDL_COPY_BLEND:
  15.371                  dstR = srcR;
  15.372                  dstG = srcG;
  15.373 @@ -1687,6 +1776,11 @@
  15.374                  dstG = (srcG * dstG) / 255;
  15.375                  dstB = (srcB * dstB) / 255;
  15.376                  break;
  15.377 +            case SDL_COPY_MUL:
  15.378 +                dstR = (srcR * dstR) / 255;
  15.379 +                dstG = (srcG * dstG) / 255;
  15.380 +                dstB = (srcB * dstB) / 255;
  15.381 +                break;
  15.382              }
  15.383              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.384              *dst = dstpixel;
  15.385 @@ -1816,7 +1910,7 @@
  15.386                      srcB = (srcB * srcA) / 255;
  15.387                  }
  15.388              }
  15.389 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.390 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.391              case SDL_COPY_BLEND:
  15.392                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.393                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.394 @@ -1832,6 +1926,11 @@
  15.395                  dstG = (srcG * dstG) / 255;
  15.396                  dstB = (srcB * dstB) / 255;
  15.397                  break;
  15.398 +            case SDL_COPY_MUL:
  15.399 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.400 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.401 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.402 +                break;
  15.403              }
  15.404              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.405              *dst = dstpixel;
  15.406 @@ -1899,7 +1998,7 @@
  15.407                      srcB = (srcB * srcA) / 255;
  15.408                  }
  15.409              }
  15.410 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.411 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.412              case SDL_COPY_BLEND:
  15.413                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.414                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.415 @@ -1915,6 +2014,11 @@
  15.416                  dstG = (srcG * dstG) / 255;
  15.417                  dstB = (srcB * dstB) / 255;
  15.418                  break;
  15.419 +            case SDL_COPY_MUL:
  15.420 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.421 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.422 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.423 +                break;
  15.424              }
  15.425              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.426              *dst = dstpixel;
  15.427 @@ -1987,7 +2091,7 @@
  15.428              srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  15.429              dstpixel = *dst;
  15.430              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  15.431 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.432 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.433              case SDL_COPY_BLEND:
  15.434                  dstR = srcR;
  15.435                  dstG = srcG;
  15.436 @@ -2004,6 +2108,12 @@
  15.437                  dstG = (srcG * dstG) / 255;
  15.438                  dstB = (srcB * dstB) / 255;
  15.439                  break;
  15.440 +            case SDL_COPY_MUL:
  15.441 +                dstR = (srcR * dstR) / 255;
  15.442 +                dstG = (srcG * dstG) / 255;
  15.443 +                dstB = (srcB * dstB) / 255;
  15.444 +                dstA = 0xFF;
  15.445 +                break;
  15.446              }
  15.447              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.448              *dst = dstpixel;
  15.449 @@ -2053,7 +2163,7 @@
  15.450              srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel;
  15.451              dstpixel = *dst;
  15.452              dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
  15.453 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.454 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.455              case SDL_COPY_BLEND:
  15.456                  dstR = srcR;
  15.457                  dstG = srcG;
  15.458 @@ -2070,6 +2180,12 @@
  15.459                  dstG = (srcG * dstG) / 255;
  15.460                  dstB = (srcB * dstB) / 255;
  15.461                  break;
  15.462 +            case SDL_COPY_MUL:
  15.463 +                dstR = (srcR * dstR) / 255;
  15.464 +                dstG = (srcG * dstG) / 255;
  15.465 +                dstB = (srcB * dstB) / 255;
  15.466 +                dstA = 0xFF;
  15.467 +                break;
  15.468              }
  15.469              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.470              *dst = dstpixel;
  15.471 @@ -2203,7 +2319,7 @@
  15.472                      srcB = (srcB * srcA) / 255;
  15.473                  }
  15.474              }
  15.475 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.476 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.477              case SDL_COPY_BLEND:
  15.478                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.479                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.480 @@ -2220,6 +2336,12 @@
  15.481                  dstG = (srcG * dstG) / 255;
  15.482                  dstB = (srcB * dstB) / 255;
  15.483                  break;
  15.484 +            case SDL_COPY_MUL:
  15.485 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.486 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.487 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.488 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
  15.489 +                break;
  15.490              }
  15.491              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.492              *dst = dstpixel;
  15.493 @@ -2287,7 +2409,7 @@
  15.494                      srcB = (srcB * srcA) / 255;
  15.495                  }
  15.496              }
  15.497 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.498 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.499              case SDL_COPY_BLEND:
  15.500                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.501                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.502 @@ -2304,6 +2426,12 @@
  15.503                  dstG = (srcG * dstG) / 255;
  15.504                  dstB = (srcB * dstB) / 255;
  15.505                  break;
  15.506 +            case SDL_COPY_MUL:
  15.507 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.508 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.509 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.510 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
  15.511 +                break;
  15.512              }
  15.513              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.514              *dst = dstpixel;
  15.515 @@ -2383,7 +2511,7 @@
  15.516                      srcB = (srcB * srcA) / 255;
  15.517                  }
  15.518              }
  15.519 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.520 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.521              case SDL_COPY_BLEND:
  15.522                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.523                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.524 @@ -2399,6 +2527,11 @@
  15.525                  dstG = (srcG * dstG) / 255;
  15.526                  dstB = (srcB * dstB) / 255;
  15.527                  break;
  15.528 +            case SDL_COPY_MUL:
  15.529 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.530 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.531 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.532 +                break;
  15.533              }
  15.534              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
  15.535              *dst = dstpixel;
  15.536 @@ -2456,7 +2589,7 @@
  15.537                      srcB = (srcB * srcA) / 255;
  15.538                  }
  15.539              }
  15.540 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.541 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.542              case SDL_COPY_BLEND:
  15.543                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.544                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.545 @@ -2472,6 +2605,11 @@
  15.546                  dstG = (srcG * dstG) / 255;
  15.547                  dstB = (srcB * dstB) / 255;
  15.548                  break;
  15.549 +            case SDL_COPY_MUL:
  15.550 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.551 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.552 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.553 +                break;
  15.554              }
  15.555              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
  15.556              *dst = dstpixel;
  15.557 @@ -2603,7 +2741,7 @@
  15.558                      srcB = (srcB * srcA) / 255;
  15.559                  }
  15.560              }
  15.561 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.562 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.563              case SDL_COPY_BLEND:
  15.564                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.565                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.566 @@ -2619,6 +2757,11 @@
  15.567                  dstG = (srcG * dstG) / 255;
  15.568                  dstB = (srcB * dstB) / 255;
  15.569                  break;
  15.570 +            case SDL_COPY_MUL:
  15.571 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.572 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.573 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.574 +                break;
  15.575              }
  15.576              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
  15.577              *dst = dstpixel;
  15.578 @@ -2688,7 +2831,7 @@
  15.579                      srcB = (srcB * srcA) / 255;
  15.580                  }
  15.581              }
  15.582 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.583 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.584              case SDL_COPY_BLEND:
  15.585                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.586                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.587 @@ -2704,6 +2847,11 @@
  15.588                  dstG = (srcG * dstG) / 255;
  15.589                  dstB = (srcB * dstB) / 255;
  15.590                  break;
  15.591 +            case SDL_COPY_MUL:
  15.592 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.593 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.594 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.595 +                break;
  15.596              }
  15.597              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
  15.598              *dst = dstpixel;
  15.599 @@ -2783,7 +2931,7 @@
  15.600                      srcB = (srcB * srcA) / 255;
  15.601                  }
  15.602              }
  15.603 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.604 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.605              case SDL_COPY_BLEND:
  15.606                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.607                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.608 @@ -2799,6 +2947,11 @@
  15.609                  dstG = (srcG * dstG) / 255;
  15.610                  dstB = (srcB * dstB) / 255;
  15.611                  break;
  15.612 +            case SDL_COPY_MUL:
  15.613 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.614 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.615 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.616 +                break;
  15.617              }
  15.618              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.619              *dst = dstpixel;
  15.620 @@ -2856,7 +3009,7 @@
  15.621                      srcB = (srcB * srcA) / 255;
  15.622                  }
  15.623              }
  15.624 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.625 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.626              case SDL_COPY_BLEND:
  15.627                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.628                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.629 @@ -2872,6 +3025,11 @@
  15.630                  dstG = (srcG * dstG) / 255;
  15.631                  dstB = (srcB * dstB) / 255;
  15.632                  break;
  15.633 +            case SDL_COPY_MUL:
  15.634 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.635 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.636 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.637 +                break;
  15.638              }
  15.639              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.640              *dst = dstpixel;
  15.641 @@ -3003,7 +3161,7 @@
  15.642                      srcB = (srcB * srcA) / 255;
  15.643                  }
  15.644              }
  15.645 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.646 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.647              case SDL_COPY_BLEND:
  15.648                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.649                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.650 @@ -3019,6 +3177,11 @@
  15.651                  dstG = (srcG * dstG) / 255;
  15.652                  dstB = (srcB * dstB) / 255;
  15.653                  break;
  15.654 +            case SDL_COPY_MUL:
  15.655 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.656 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.657 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.658 +                break;
  15.659              }
  15.660              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.661              *dst = dstpixel;
  15.662 @@ -3088,7 +3251,7 @@
  15.663                      srcB = (srcB * srcA) / 255;
  15.664                  }
  15.665              }
  15.666 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.667 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.668              case SDL_COPY_BLEND:
  15.669                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.670                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.671 @@ -3104,6 +3267,11 @@
  15.672                  dstG = (srcG * dstG) / 255;
  15.673                  dstB = (srcB * dstB) / 255;
  15.674                  break;
  15.675 +            case SDL_COPY_MUL:
  15.676 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.677 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.678 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.679 +                break;
  15.680              }
  15.681              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.682              *dst = dstpixel;
  15.683 @@ -3178,7 +3346,7 @@
  15.684                      srcB = (srcB * srcA) / 255;
  15.685                  }
  15.686              }
  15.687 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.688 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.689              case SDL_COPY_BLEND:
  15.690                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.691                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.692 @@ -3195,6 +3363,12 @@
  15.693                  dstG = (srcG * dstG) / 255;
  15.694                  dstB = (srcB * dstB) / 255;
  15.695                  break;
  15.696 +            case SDL_COPY_MUL:
  15.697 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.698 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.699 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.700 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
  15.701 +                break;
  15.702              }
  15.703              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.704              *dst = dstpixel;
  15.705 @@ -3252,7 +3426,7 @@
  15.706                      srcB = (srcB * srcA) / 255;
  15.707                  }
  15.708              }
  15.709 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.710 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.711              case SDL_COPY_BLEND:
  15.712                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.713                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.714 @@ -3269,6 +3443,12 @@
  15.715                  dstG = (srcG * dstG) / 255;
  15.716                  dstB = (srcB * dstB) / 255;
  15.717                  break;
  15.718 +            case SDL_COPY_MUL:
  15.719 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.720 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.721 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.722 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
  15.723 +                break;
  15.724              }
  15.725              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.726              *dst = dstpixel;
  15.727 @@ -3408,7 +3588,7 @@
  15.728                      srcB = (srcB * srcA) / 255;
  15.729                  }
  15.730              }
  15.731 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.732 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.733              case SDL_COPY_BLEND:
  15.734                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.735                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.736 @@ -3425,6 +3605,12 @@
  15.737                  dstG = (srcG * dstG) / 255;
  15.738                  dstB = (srcB * dstB) / 255;
  15.739                  break;
  15.740 +            case SDL_COPY_MUL:
  15.741 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.742 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.743 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.744 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
  15.745 +                break;
  15.746              }
  15.747              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.748              *dst = dstpixel;
  15.749 @@ -3494,7 +3680,7 @@
  15.750                      srcB = (srcB * srcA) / 255;
  15.751                  }
  15.752              }
  15.753 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.754 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.755              case SDL_COPY_BLEND:
  15.756                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.757                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.758 @@ -3511,6 +3697,12 @@
  15.759                  dstG = (srcG * dstG) / 255;
  15.760                  dstB = (srcB * dstB) / 255;
  15.761                  break;
  15.762 +            case SDL_COPY_MUL:
  15.763 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.764 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.765 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.766 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
  15.767 +                break;
  15.768              }
  15.769              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.770              *dst = dstpixel;
  15.771 @@ -3590,7 +3782,7 @@
  15.772                      srcB = (srcB * srcA) / 255;
  15.773                  }
  15.774              }
  15.775 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.776 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.777              case SDL_COPY_BLEND:
  15.778                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.779                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.780 @@ -3606,6 +3798,11 @@
  15.781                  dstG = (srcG * dstG) / 255;
  15.782                  dstB = (srcB * dstB) / 255;
  15.783                  break;
  15.784 +            case SDL_COPY_MUL:
  15.785 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.786 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.787 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.788 +                break;
  15.789              }
  15.790              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
  15.791              *dst = dstpixel;
  15.792 @@ -3663,7 +3860,7 @@
  15.793                      srcB = (srcB * srcA) / 255;
  15.794                  }
  15.795              }
  15.796 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.797 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.798              case SDL_COPY_BLEND:
  15.799                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.800                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.801 @@ -3679,6 +3876,11 @@
  15.802                  dstG = (srcG * dstG) / 255;
  15.803                  dstB = (srcB * dstB) / 255;
  15.804                  break;
  15.805 +            case SDL_COPY_MUL:
  15.806 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.807 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.808 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.809 +                break;
  15.810              }
  15.811              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
  15.812              *dst = dstpixel;
  15.813 @@ -3810,7 +4012,7 @@
  15.814                      srcB = (srcB * srcA) / 255;
  15.815                  }
  15.816              }
  15.817 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.818 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.819              case SDL_COPY_BLEND:
  15.820                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.821                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.822 @@ -3826,6 +4028,11 @@
  15.823                  dstG = (srcG * dstG) / 255;
  15.824                  dstB = (srcB * dstB) / 255;
  15.825                  break;
  15.826 +            case SDL_COPY_MUL:
  15.827 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.828 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.829 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.830 +                break;
  15.831              }
  15.832              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
  15.833              *dst = dstpixel;
  15.834 @@ -3895,7 +4102,7 @@
  15.835                      srcB = (srcB * srcA) / 255;
  15.836                  }
  15.837              }
  15.838 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.839 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.840              case SDL_COPY_BLEND:
  15.841                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.842                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.843 @@ -3911,6 +4118,11 @@
  15.844                  dstG = (srcG * dstG) / 255;
  15.845                  dstB = (srcB * dstB) / 255;
  15.846                  break;
  15.847 +            case SDL_COPY_MUL:
  15.848 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.849 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.850 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.851 +                break;
  15.852              }
  15.853              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
  15.854              *dst = dstpixel;
  15.855 @@ -3990,7 +4202,7 @@
  15.856                      srcB = (srcB * srcA) / 255;
  15.857                  }
  15.858              }
  15.859 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.860 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.861              case SDL_COPY_BLEND:
  15.862                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.863                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.864 @@ -4006,6 +4218,11 @@
  15.865                  dstG = (srcG * dstG) / 255;
  15.866                  dstB = (srcB * dstB) / 255;
  15.867                  break;
  15.868 +            case SDL_COPY_MUL:
  15.869 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.870 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.871 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.872 +                break;
  15.873              }
  15.874              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.875              *dst = dstpixel;
  15.876 @@ -4063,7 +4280,7 @@
  15.877                      srcB = (srcB * srcA) / 255;
  15.878                  }
  15.879              }
  15.880 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.881 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.882              case SDL_COPY_BLEND:
  15.883                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.884                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.885 @@ -4079,6 +4296,11 @@
  15.886                  dstG = (srcG * dstG) / 255;
  15.887                  dstB = (srcB * dstB) / 255;
  15.888                  break;
  15.889 +            case SDL_COPY_MUL:
  15.890 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.891 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.892 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.893 +                break;
  15.894              }
  15.895              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.896              *dst = dstpixel;
  15.897 @@ -4210,7 +4432,7 @@
  15.898                      srcB = (srcB * srcA) / 255;
  15.899                  }
  15.900              }
  15.901 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.902 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.903              case SDL_COPY_BLEND:
  15.904                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.905                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.906 @@ -4226,6 +4448,11 @@
  15.907                  dstG = (srcG * dstG) / 255;
  15.908                  dstB = (srcB * dstB) / 255;
  15.909                  break;
  15.910 +            case SDL_COPY_MUL:
  15.911 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.912 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.913 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.914 +                break;
  15.915              }
  15.916              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.917              *dst = dstpixel;
  15.918 @@ -4295,7 +4522,7 @@
  15.919                      srcB = (srcB * srcA) / 255;
  15.920                  }
  15.921              }
  15.922 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.923 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.924              case SDL_COPY_BLEND:
  15.925                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.926                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.927 @@ -4311,6 +4538,11 @@
  15.928                  dstG = (srcG * dstG) / 255;
  15.929                  dstB = (srcB * dstB) / 255;
  15.930                  break;
  15.931 +            case SDL_COPY_MUL:
  15.932 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.933 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.934 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.935 +                break;
  15.936              }
  15.937              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
  15.938              *dst = dstpixel;
  15.939 @@ -4390,7 +4622,7 @@
  15.940                      srcB = (srcB * srcA) / 255;
  15.941                  }
  15.942              }
  15.943 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.944 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.945              case SDL_COPY_BLEND:
  15.946                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.947                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.948 @@ -4407,6 +4639,12 @@
  15.949                  dstG = (srcG * dstG) / 255;
  15.950                  dstB = (srcB * dstB) / 255;
  15.951                  break;
  15.952 +            case SDL_COPY_MUL:
  15.953 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.954 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.955 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.956 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
  15.957 +                break;
  15.958              }
  15.959              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.960              *dst = dstpixel;
  15.961 @@ -4464,7 +4702,7 @@
  15.962                      srcB = (srcB * srcA) / 255;
  15.963                  }
  15.964              }
  15.965 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.966 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.967              case SDL_COPY_BLEND:
  15.968                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.969                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.970 @@ -4481,6 +4719,12 @@
  15.971                  dstG = (srcG * dstG) / 255;
  15.972                  dstB = (srcB * dstB) / 255;
  15.973                  break;
  15.974 +            case SDL_COPY_MUL:
  15.975 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.976 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.977 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
  15.978 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
  15.979 +                break;
  15.980              }
  15.981              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
  15.982              *dst = dstpixel;
  15.983 @@ -4620,7 +4864,7 @@
  15.984                      srcB = (srcB * srcA) / 255;
  15.985                  }
  15.986              }
  15.987 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
  15.988 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
  15.989              case SDL_COPY_BLEND:
  15.990                  dstR = srcR + ((255 - srcA) * dstR) / 255;
  15.991                  dstG = srcG + ((255 - srcA) * dstG) / 255;
  15.992 @@ -4637,6 +4881,12 @@
  15.993                  dstG = (srcG * dstG) / 255;
  15.994                  dstB = (srcB * dstB) / 255;
  15.995                  break;
  15.996 +            case SDL_COPY_MUL:
  15.997 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
  15.998 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
  15.999 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1000 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
 15.1001 +                break;
 15.1002              }
 15.1003              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
 15.1004              *dst = dstpixel;
 15.1005 @@ -4706,7 +4956,7 @@
 15.1006                      srcB = (srcB * srcA) / 255;
 15.1007                  }
 15.1008              }
 15.1009 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1010 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1011              case SDL_COPY_BLEND:
 15.1012                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1013                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1014 @@ -4723,6 +4973,12 @@
 15.1015                  dstG = (srcG * dstG) / 255;
 15.1016                  dstB = (srcB * dstB) / 255;
 15.1017                  break;
 15.1018 +            case SDL_COPY_MUL:
 15.1019 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1020 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1021 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1022 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
 15.1023 +                break;
 15.1024              }
 15.1025              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
 15.1026              *dst = dstpixel;
 15.1027 @@ -4802,7 +5058,7 @@
 15.1028                      srcB = (srcB * srcA) / 255;
 15.1029                  }
 15.1030              }
 15.1031 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1032 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1033              case SDL_COPY_BLEND:
 15.1034                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1035                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1036 @@ -4818,6 +5074,11 @@
 15.1037                  dstG = (srcG * dstG) / 255;
 15.1038                  dstB = (srcB * dstB) / 255;
 15.1039                  break;
 15.1040 +            case SDL_COPY_MUL:
 15.1041 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1042 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1043 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1044 +                break;
 15.1045              }
 15.1046              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
 15.1047              *dst = dstpixel;
 15.1048 @@ -4875,7 +5136,7 @@
 15.1049                      srcB = (srcB * srcA) / 255;
 15.1050                  }
 15.1051              }
 15.1052 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1053 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1054              case SDL_COPY_BLEND:
 15.1055                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1056                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1057 @@ -4891,6 +5152,11 @@
 15.1058                  dstG = (srcG * dstG) / 255;
 15.1059                  dstB = (srcB * dstB) / 255;
 15.1060                  break;
 15.1061 +            case SDL_COPY_MUL:
 15.1062 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1063 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1064 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1065 +                break;
 15.1066              }
 15.1067              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
 15.1068              *dst = dstpixel;
 15.1069 @@ -5022,7 +5288,7 @@
 15.1070                      srcB = (srcB * srcA) / 255;
 15.1071                  }
 15.1072              }
 15.1073 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1074 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1075              case SDL_COPY_BLEND:
 15.1076                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1077                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1078 @@ -5038,6 +5304,11 @@
 15.1079                  dstG = (srcG * dstG) / 255;
 15.1080                  dstB = (srcB * dstB) / 255;
 15.1081                  break;
 15.1082 +            case SDL_COPY_MUL:
 15.1083 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1084 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1085 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1086 +                break;
 15.1087              }
 15.1088              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
 15.1089              *dst = dstpixel;
 15.1090 @@ -5107,7 +5378,7 @@
 15.1091                      srcB = (srcB * srcA) / 255;
 15.1092                  }
 15.1093              }
 15.1094 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1095 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1096              case SDL_COPY_BLEND:
 15.1097                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1098                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1099 @@ -5123,6 +5394,11 @@
 15.1100                  dstG = (srcG * dstG) / 255;
 15.1101                  dstB = (srcB * dstB) / 255;
 15.1102                  break;
 15.1103 +            case SDL_COPY_MUL:
 15.1104 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1105 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1106 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1107 +                break;
 15.1108              }
 15.1109              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
 15.1110              *dst = dstpixel;
 15.1111 @@ -5202,7 +5478,7 @@
 15.1112                      srcB = (srcB * srcA) / 255;
 15.1113                  }
 15.1114              }
 15.1115 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1116 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1117              case SDL_COPY_BLEND:
 15.1118                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1119                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1120 @@ -5218,6 +5494,11 @@
 15.1121                  dstG = (srcG * dstG) / 255;
 15.1122                  dstB = (srcB * dstB) / 255;
 15.1123                  break;
 15.1124 +            case SDL_COPY_MUL:
 15.1125 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1126 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1127 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1128 +                break;
 15.1129              }
 15.1130              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
 15.1131              *dst = dstpixel;
 15.1132 @@ -5275,7 +5556,7 @@
 15.1133                      srcB = (srcB * srcA) / 255;
 15.1134                  }
 15.1135              }
 15.1136 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1137 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1138              case SDL_COPY_BLEND:
 15.1139                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1140                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1141 @@ -5291,6 +5572,11 @@
 15.1142                  dstG = (srcG * dstG) / 255;
 15.1143                  dstB = (srcB * dstB) / 255;
 15.1144                  break;
 15.1145 +            case SDL_COPY_MUL:
 15.1146 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1147 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1148 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1149 +                break;
 15.1150              }
 15.1151              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
 15.1152              *dst = dstpixel;
 15.1153 @@ -5422,7 +5708,7 @@
 15.1154                      srcB = (srcB * srcA) / 255;
 15.1155                  }
 15.1156              }
 15.1157 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1158 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1159              case SDL_COPY_BLEND:
 15.1160                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1161                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1162 @@ -5438,6 +5724,11 @@
 15.1163                  dstG = (srcG * dstG) / 255;
 15.1164                  dstB = (srcB * dstB) / 255;
 15.1165                  break;
 15.1166 +            case SDL_COPY_MUL:
 15.1167 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1168 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1169 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1170 +                break;
 15.1171              }
 15.1172              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
 15.1173              *dst = dstpixel;
 15.1174 @@ -5507,7 +5798,7 @@
 15.1175                      srcB = (srcB * srcA) / 255;
 15.1176                  }
 15.1177              }
 15.1178 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1179 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1180              case SDL_COPY_BLEND:
 15.1181                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1182                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1183 @@ -5523,6 +5814,11 @@
 15.1184                  dstG = (srcG * dstG) / 255;
 15.1185                  dstB = (srcB * dstB) / 255;
 15.1186                  break;
 15.1187 +            case SDL_COPY_MUL:
 15.1188 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1189 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1190 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1191 +                break;
 15.1192              }
 15.1193              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
 15.1194              *dst = dstpixel;
 15.1195 @@ -5602,7 +5898,7 @@
 15.1196                      srcB = (srcB * srcA) / 255;
 15.1197                  }
 15.1198              }
 15.1199 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1200 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1201              case SDL_COPY_BLEND:
 15.1202                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1203                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1204 @@ -5619,6 +5915,12 @@
 15.1205                  dstG = (srcG * dstG) / 255;
 15.1206                  dstB = (srcB * dstB) / 255;
 15.1207                  break;
 15.1208 +            case SDL_COPY_MUL:
 15.1209 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1210 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1211 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1212 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
 15.1213 +                break;
 15.1214              }
 15.1215              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
 15.1216              *dst = dstpixel;
 15.1217 @@ -5676,7 +5978,7 @@
 15.1218                      srcB = (srcB * srcA) / 255;
 15.1219                  }
 15.1220              }
 15.1221 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1222 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1223              case SDL_COPY_BLEND:
 15.1224                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1225                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1226 @@ -5693,6 +5995,12 @@
 15.1227                  dstG = (srcG * dstG) / 255;
 15.1228                  dstB = (srcB * dstB) / 255;
 15.1229                  break;
 15.1230 +            case SDL_COPY_MUL:
 15.1231 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1232 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1233 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1234 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
 15.1235 +                break;
 15.1236              }
 15.1237              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
 15.1238              *dst = dstpixel;
 15.1239 @@ -5832,7 +6140,7 @@
 15.1240                      srcB = (srcB * srcA) / 255;
 15.1241                  }
 15.1242              }
 15.1243 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1244 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1245              case SDL_COPY_BLEND:
 15.1246                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1247                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1248 @@ -5849,6 +6157,12 @@
 15.1249                  dstG = (srcG * dstG) / 255;
 15.1250                  dstB = (srcB * dstB) / 255;
 15.1251                  break;
 15.1252 +            case SDL_COPY_MUL:
 15.1253 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1254 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1255 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1256 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
 15.1257 +                break;
 15.1258              }
 15.1259              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
 15.1260              *dst = dstpixel;
 15.1261 @@ -5918,7 +6232,7 @@
 15.1262                      srcB = (srcB * srcA) / 255;
 15.1263                  }
 15.1264              }
 15.1265 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1266 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1267              case SDL_COPY_BLEND:
 15.1268                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1269                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1270 @@ -5935,6 +6249,12 @@
 15.1271                  dstG = (srcG * dstG) / 255;
 15.1272                  dstB = (srcB * dstB) / 255;
 15.1273                  break;
 15.1274 +            case SDL_COPY_MUL:
 15.1275 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1276 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1277 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1278 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
 15.1279 +                break;
 15.1280              }
 15.1281              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
 15.1282              *dst = dstpixel;
 15.1283 @@ -6014,7 +6334,7 @@
 15.1284                      srcB = (srcB * srcA) / 255;
 15.1285                  }
 15.1286              }
 15.1287 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1288 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1289              case SDL_COPY_BLEND:
 15.1290                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1291                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1292 @@ -6030,6 +6350,11 @@
 15.1293                  dstG = (srcG * dstG) / 255;
 15.1294                  dstB = (srcB * dstB) / 255;
 15.1295                  break;
 15.1296 +            case SDL_COPY_MUL:
 15.1297 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1298 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1299 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1300 +                break;
 15.1301              }
 15.1302              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
 15.1303              *dst = dstpixel;
 15.1304 @@ -6087,7 +6412,7 @@
 15.1305                      srcB = (srcB * srcA) / 255;
 15.1306                  }
 15.1307              }
 15.1308 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1309 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1310              case SDL_COPY_BLEND:
 15.1311                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1312                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1313 @@ -6103,6 +6428,11 @@
 15.1314                  dstG = (srcG * dstG) / 255;
 15.1315                  dstB = (srcB * dstB) / 255;
 15.1316                  break;
 15.1317 +            case SDL_COPY_MUL:
 15.1318 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1319 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1320 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1321 +                break;
 15.1322              }
 15.1323              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
 15.1324              *dst = dstpixel;
 15.1325 @@ -6234,7 +6564,7 @@
 15.1326                      srcB = (srcB * srcA) / 255;
 15.1327                  }
 15.1328              }
 15.1329 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1330 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1331              case SDL_COPY_BLEND:
 15.1332                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1333                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1334 @@ -6250,6 +6580,11 @@
 15.1335                  dstG = (srcG * dstG) / 255;
 15.1336                  dstB = (srcB * dstB) / 255;
 15.1337                  break;
 15.1338 +            case SDL_COPY_MUL:
 15.1339 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1340 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1341 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1342 +                break;
 15.1343              }
 15.1344              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
 15.1345              *dst = dstpixel;
 15.1346 @@ -6319,7 +6654,7 @@
 15.1347                      srcB = (srcB * srcA) / 255;
 15.1348                  }
 15.1349              }
 15.1350 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1351 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1352              case SDL_COPY_BLEND:
 15.1353                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1354                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1355 @@ -6335,6 +6670,11 @@
 15.1356                  dstG = (srcG * dstG) / 255;
 15.1357                  dstB = (srcB * dstB) / 255;
 15.1358                  break;
 15.1359 +            case SDL_COPY_MUL:
 15.1360 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1361 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1362 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1363 +                break;
 15.1364              }
 15.1365              dstpixel = (dstR << 16) | (dstG << 8) | dstB;
 15.1366              *dst = dstpixel;
 15.1367 @@ -6414,7 +6754,7 @@
 15.1368                      srcB = (srcB * srcA) / 255;
 15.1369                  }
 15.1370              }
 15.1371 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1372 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1373              case SDL_COPY_BLEND:
 15.1374                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1375                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1376 @@ -6430,6 +6770,11 @@
 15.1377                  dstG = (srcG * dstG) / 255;
 15.1378                  dstB = (srcB * dstB) / 255;
 15.1379                  break;
 15.1380 +            case SDL_COPY_MUL:
 15.1381 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1382 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1383 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1384 +                break;
 15.1385              }
 15.1386              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
 15.1387              *dst = dstpixel;
 15.1388 @@ -6487,7 +6832,7 @@
 15.1389                      srcB = (srcB * srcA) / 255;
 15.1390                  }
 15.1391              }
 15.1392 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1393 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1394              case SDL_COPY_BLEND:
 15.1395                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1396                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1397 @@ -6503,6 +6848,11 @@
 15.1398                  dstG = (srcG * dstG) / 255;
 15.1399                  dstB = (srcB * dstB) / 255;
 15.1400                  break;
 15.1401 +            case SDL_COPY_MUL:
 15.1402 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1403 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1404 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1405 +                break;
 15.1406              }
 15.1407              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
 15.1408              *dst = dstpixel;
 15.1409 @@ -6634,7 +6984,7 @@
 15.1410                      srcB = (srcB * srcA) / 255;
 15.1411                  }
 15.1412              }
 15.1413 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1414 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1415              case SDL_COPY_BLEND:
 15.1416                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1417                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1418 @@ -6650,6 +7000,11 @@
 15.1419                  dstG = (srcG * dstG) / 255;
 15.1420                  dstB = (srcB * dstB) / 255;
 15.1421                  break;
 15.1422 +            case SDL_COPY_MUL:
 15.1423 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1424 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1425 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1426 +                break;
 15.1427              }
 15.1428              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
 15.1429              *dst = dstpixel;
 15.1430 @@ -6719,7 +7074,7 @@
 15.1431                      srcB = (srcB * srcA) / 255;
 15.1432                  }
 15.1433              }
 15.1434 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1435 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1436              case SDL_COPY_BLEND:
 15.1437                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1438                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1439 @@ -6735,6 +7090,11 @@
 15.1440                  dstG = (srcG * dstG) / 255;
 15.1441                  dstB = (srcB * dstB) / 255;
 15.1442                  break;
 15.1443 +            case SDL_COPY_MUL:
 15.1444 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1445 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1446 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1447 +                break;
 15.1448              }
 15.1449              dstpixel = (dstB << 16) | (dstG << 8) | dstR;
 15.1450              *dst = dstpixel;
 15.1451 @@ -6814,7 +7174,7 @@
 15.1452                      srcB = (srcB * srcA) / 255;
 15.1453                  }
 15.1454              }
 15.1455 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1456 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1457              case SDL_COPY_BLEND:
 15.1458                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1459                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1460 @@ -6831,6 +7191,12 @@
 15.1461                  dstG = (srcG * dstG) / 255;
 15.1462                  dstB = (srcB * dstB) / 255;
 15.1463                  break;
 15.1464 +            case SDL_COPY_MUL:
 15.1465 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1466 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1467 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1468 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
 15.1469 +                break;
 15.1470              }
 15.1471              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
 15.1472              *dst = dstpixel;
 15.1473 @@ -6888,7 +7254,7 @@
 15.1474                      srcB = (srcB * srcA) / 255;
 15.1475                  }
 15.1476              }
 15.1477 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1478 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1479              case SDL_COPY_BLEND:
 15.1480                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1481                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1482 @@ -6905,6 +7271,12 @@
 15.1483                  dstG = (srcG * dstG) / 255;
 15.1484                  dstB = (srcB * dstB) / 255;
 15.1485                  break;
 15.1486 +            case SDL_COPY_MUL:
 15.1487 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1488 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1489 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1490 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
 15.1491 +                break;
 15.1492              }
 15.1493              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
 15.1494              *dst = dstpixel;
 15.1495 @@ -7044,7 +7416,7 @@
 15.1496                      srcB = (srcB * srcA) / 255;
 15.1497                  }
 15.1498              }
 15.1499 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1500 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1501              case SDL_COPY_BLEND:
 15.1502                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1503                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1504 @@ -7061,6 +7433,12 @@
 15.1505                  dstG = (srcG * dstG) / 255;
 15.1506                  dstB = (srcB * dstB) / 255;
 15.1507                  break;
 15.1508 +            case SDL_COPY_MUL:
 15.1509 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1510 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1511 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1512 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
 15.1513 +                break;
 15.1514              }
 15.1515              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
 15.1516              *dst = dstpixel;
 15.1517 @@ -7130,7 +7508,7 @@
 15.1518                      srcB = (srcB * srcA) / 255;
 15.1519                  }
 15.1520              }
 15.1521 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
 15.1522 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
 15.1523              case SDL_COPY_BLEND:
 15.1524                  dstR = srcR + ((255 - srcA) * dstR) / 255;
 15.1525                  dstG = srcG + ((255 - srcA) * dstG) / 255;
 15.1526 @@ -7147,6 +7525,12 @@
 15.1527                  dstG = (srcG * dstG) / 255;
 15.1528                  dstB = (srcB * dstB) / 255;
 15.1529                  break;
 15.1530 +            case SDL_COPY_MUL:
 15.1531 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255;
 15.1532 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255;
 15.1533 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255;
 15.1534 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255; if (dstA > 255) dstA = 255;
 15.1535 +                break;
 15.1536              }
 15.1537              dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB;
 15.1538              *dst = dstpixel;
 15.1539 @@ -7160,131 +7544,131 @@
 15.1540  
 15.1541  SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[] = {
 15.1542      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Scale },
 15.1543 -    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Blend },
 15.1544 -    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Blend_Scale },
 15.1545 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Blend },
 15.1546 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Blend_Scale },
 15.1547      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate },
 15.1548      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Scale },
 15.1549 -    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Blend },
 15.1550 -    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale },
 15.1551 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Blend },
 15.1552 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale },
 15.1553      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Scale },
 15.1554 -    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Blend },
 15.1555 -    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Blend_Scale },
 15.1556 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Blend },
 15.1557 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Blend_Scale },
 15.1558      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate },
 15.1559      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Scale },
 15.1560 -    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Blend },
 15.1561 -    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale },
 15.1562 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Blend },
 15.1563 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale },
 15.1564      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Scale },
 15.1565 -    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Blend },
 15.1566 -    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Blend_Scale },
 15.1567 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Blend },
 15.1568 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Blend_Scale },
 15.1569      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate },
 15.1570      { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Scale },
 15.1571 -    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Blend },
 15.1572 -    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale },
 15.1573 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Blend },
 15.1574 +    { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale },
 15.1575      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Scale },
 15.1576 -    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Blend },
 15.1577 -    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Blend_Scale },
 15.1578 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Blend },
 15.1579 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Blend_Scale },
 15.1580      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate },
 15.1581      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Scale },
 15.1582 -    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Blend },
 15.1583 -    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale },
 15.1584 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Blend },
 15.1585 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale },
 15.1586      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Scale },
 15.1587 -    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Blend },
 15.1588 -    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Blend_Scale },
 15.1589 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Blend },
 15.1590 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Blend_Scale },
 15.1591      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate },
 15.1592      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Scale },
 15.1593 -    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Blend },
 15.1594 -    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale },
 15.1595 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Blend },
 15.1596 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale },
 15.1597      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Scale },
 15.1598 -    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Blend },
 15.1599 -    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Blend_Scale },
 15.1600 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Blend },
 15.1601 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Blend_Scale },
 15.1602      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate },
 15.1603      { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Scale },
 15.1604 -    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Blend },
 15.1605 -    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale },
 15.1606 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Blend },
 15.1607 +    { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale },
 15.1608      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Scale },
 15.1609 -    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Blend },
 15.1610 -    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Blend_Scale },
 15.1611 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Blend },
 15.1612 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Blend_Scale },
 15.1613      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate },
 15.1614      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Scale },
 15.1615 -    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Blend },
 15.1616 -    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale },
 15.1617 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Blend },
 15.1618 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale },
 15.1619      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Scale },
 15.1620 -    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Blend },
 15.1621 -    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Blend_Scale },
 15.1622 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Blend },
 15.1623 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Blend_Scale },
 15.1624      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate },
 15.1625      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Scale },
 15.1626 -    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Blend },
 15.1627 -    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale },
 15.1628 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Blend },
 15.1629 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale },
 15.1630      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Scale },
 15.1631 -    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend },
 15.1632 -    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend_Scale },
 15.1633 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend },
 15.1634 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend_Scale },
 15.1635      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate },
 15.1636      { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale },
 15.1637 -    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend },
 15.1638 -    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale },
 15.1639 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend },
 15.1640 +    { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale },
 15.1641      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Scale },
 15.1642 -    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Blend },
 15.1643 -    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Blend_Scale },
 15.1644 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Blend },
 15.1645 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Blend_Scale },
 15.1646      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate },
 15.1647      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Scale },
 15.1648 -    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Blend },
 15.1649 -    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale },
 15.1650 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Blend },
 15.1651 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale },
 15.1652      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Scale },
 15.1653 -    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Blend },
 15.1654 -    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Blend_Scale },
 15.1655 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Blend },
 15.1656 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Blend_Scale },
 15.1657      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate },
 15.1658      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Scale },
 15.1659 -    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Blend },
 15.1660 -    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale },
 15.1661 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Blend },
 15.1662 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale },
 15.1663      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Scale },
 15.1664 -    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend },
 15.1665 -    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend_Scale },
 15.1666 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend },
 15.1667 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend_Scale },
 15.1668      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate },
 15.1669      { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale },
 15.1670 -    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend },
 15.1671 -    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale },
 15.1672 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend },
 15.1673 +    { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale },
 15.1674      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Scale },
 15.1675 -    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Blend },
 15.1676 -    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Blend_Scale },
 15.1677 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Blend },
 15.1678 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Blend_Scale },
 15.1679      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate },
 15.1680      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Scale },
 15.1681 -    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Blend },
 15.1682 -    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale },
 15.1683 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Blend },
 15.1684 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale },
 15.1685      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Scale },
 15.1686 -    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Blend },
 15.1687 -    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Blend_Scale },
 15.1688 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Blend },
 15.1689 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Blend_Scale },
 15.1690      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate },
 15.1691      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Scale },
 15.1692 -    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Blend },
 15.1693 -    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale },
 15.1694 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Blend },
 15.1695 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale },
 15.1696      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Scale },
 15.1697 -    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend },
 15.1698 -    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend_Scale },
 15.1699 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend },
 15.1700 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend_Scale },
 15.1701      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate },
 15.1702      { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale },
 15.1703 -    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend },
 15.1704 -    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale },
 15.1705 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend },
 15.1706 +    { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale },
 15.1707      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Scale },
 15.1708 -    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Blend },
 15.1709 -    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Blend_Scale },
 15.1710 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Blend },
 15.1711 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Blend_Scale },
 15.1712      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate },
 15.1713      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Scale },
 15.1714 -    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Blend },
 15.1715 -    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale },
 15.1716 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Blend },
 15.1717 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale },
 15.1718      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Scale },
 15.1719 -    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Blend },
 15.1720 -    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Blend_Scale },
 15.1721 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Blend },
 15.1722 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Blend_Scale },
 15.1723      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate },
 15.1724      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Scale },
 15.1725 -    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Blend },
 15.1726 -    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale },
 15.1727 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Blend },
 15.1728 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale },
 15.1729      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Scale },
 15.1730 -    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend },
 15.1731 -    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend_Scale },
 15.1732 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend },
 15.1733 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend_Scale },
 15.1734      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate },
 15.1735      { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale },
 15.1736 -    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend },
 15.1737 -    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale },
 15.1738 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend },
 15.1739 +    { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale },
 15.1740      { 0, 0, 0, 0, NULL }
 15.1741  };
 15.1742  
    16.1 --- a/src/video/SDL_blit_slow.c	Wed Jan 15 22:18:31 2020 -0800
    16.2 +++ b/src/video/SDL_blit_slow.c	Thu Jan 16 08:52:59 2020 -0800
    16.3 @@ -118,7 +118,7 @@
    16.4                      srcB = (srcB * srcA) / 255;
    16.5                  }
    16.6              }
    16.7 -            switch (flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD)) {
    16.8 +            switch (flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL)) {
    16.9              case 0:
   16.10                  dstR = srcR;
   16.11                  dstG = srcG;
   16.12 @@ -147,6 +147,20 @@
   16.13                  dstG = (srcG * dstG) / 255;
   16.14                  dstB = (srcB * dstB) / 255;
   16.15                  break;
   16.16 +            case SDL_COPY_MUL:
   16.17 +                dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255;
   16.18 +                if (dstR > 255)
   16.19 +                    dstR = 255;
   16.20 +                dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255;
   16.21 +                if (dstG > 255)
   16.22 +                    dstG = 255;
   16.23 +                dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255;
   16.24 +                if (dstB > 255)
   16.25 +                    dstB = 255;
   16.26 +                dstA = ((srcA * dstA) + (dstA * (255 - srcA))) / 255;
   16.27 +                if (dstA > 255)
   16.28 +                    dstA = 255;
   16.29 +                break;
   16.30              }
   16.31              if (dst_fmt->Amask) {
   16.32                  ASSEMBLE_RGBA(dst, dstbpp, dst_fmt, dstR, dstG, dstB, dstA);
    17.1 --- a/src/video/SDL_surface.c	Wed Jan 15 22:18:31 2020 -0800
    17.2 +++ b/src/video/SDL_surface.c	Thu Jan 16 08:52:59 2020 -0800
    17.3 @@ -495,7 +495,7 @@
    17.4      status = 0;
    17.5      flags = surface->map->info.flags;
    17.6      surface->map->info.flags &=
    17.7 -        ~(SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD);
    17.8 +        ~(SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL);
    17.9      switch (blendMode) {
   17.10      case SDL_BLENDMODE_NONE:
   17.11          break;
   17.12 @@ -508,6 +508,9 @@
   17.13      case SDL_BLENDMODE_MOD:
   17.14          surface->map->info.flags |= SDL_COPY_MOD;
   17.15          break;
   17.16 +    case SDL_BLENDMODE_MUL:
   17.17 +        surface->map->info.flags |= SDL_COPY_MUL;
   17.18 +        break;
   17.19      default:
   17.20          status = SDL_Unsupported();
   17.21          break;
   17.22 @@ -532,7 +535,7 @@
   17.23      }
   17.24  
   17.25      switch (surface->map->
   17.26 -            info.flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD)) {
   17.27 +            info.flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL)) {
   17.28      case SDL_COPY_BLEND:
   17.29          *blendMode = SDL_BLENDMODE_BLEND;
   17.30          break;
   17.31 @@ -542,6 +545,9 @@
   17.32      case SDL_COPY_MOD:
   17.33          *blendMode = SDL_BLENDMODE_MOD;
   17.34          break;
   17.35 +    case SDL_COPY_MUL:
   17.36 +        *blendMode = SDL_BLENDMODE_MUL;
   17.37 +        break;
   17.38      default:
   17.39          *blendMode = SDL_BLENDMODE_NONE;
   17.40          break;
   17.41 @@ -874,7 +880,7 @@
   17.42  {
   17.43      static const Uint32 complex_copy_flags = (
   17.44          SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA |
   17.45 -        SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD |
   17.46 +        SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL |
   17.47          SDL_COPY_COLORKEY
   17.48      );
   17.49  
    18.1 --- a/src/video/directfb/SDL_DirectFB_render.c	Wed Jan 15 22:18:31 2020 -0800
    18.2 +++ b/src/video/directfb/SDL_DirectFB_render.c	Thu Jan 16 08:52:59 2020 -0800
    18.3 @@ -199,6 +199,14 @@
    18.4  
    18.5              break;
    18.6          }
    18.7 +        case SDL_BLENDMODE_MUL:
    18.8 +            data->blitFlags = DSBLIT_BLEND_ALPHACHANNEL;
    18.9 +            data->drawFlags = DSDRAW_BLEND;
   18.10 +            SDL_DFB_CHECK(destsurf->SetSrcBlendFunction(destsurf, DSBF_DSTCOLOR));
   18.11 +            SDL_DFB_CHECK(destsurf->SetDstBlendFunction(destsurf, DSBF_INVSRCALPHA));
   18.12 +
   18.13 +            break;
   18.14 +        }
   18.15          data->lastBlendMode = blendMode;
   18.16      }
   18.17  }
   18.18 @@ -223,6 +231,7 @@
   18.19          break;
   18.20      case SDL_BLENDMODE_ADD:
   18.21      case SDL_BLENDMODE_MOD:
   18.22 +    case SDL_BLENDMODE_MUL:
   18.23          r = ((int) r * (int) a) / 255;
   18.24          g = ((int) g * (int) a) / 255;
   18.25          b = ((int) b * (int) a) / 255;
    19.1 --- a/src/video/sdlgenblit.pl	Wed Jan 15 22:18:31 2020 -0800
    19.2 +++ b/src/video/sdlgenblit.pl	Thu Jan 16 08:52:59 2020 -0800
    19.3 @@ -267,7 +267,7 @@
    19.4  __EOF__
    19.5          }
    19.6          print FILE <<__EOF__;
    19.7 -            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
    19.8 +            switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) {
    19.9              case SDL_COPY_BLEND:
   19.10  __EOF__
   19.11          if ($A_is_const_FF) {
   19.12 @@ -307,6 +307,35 @@
   19.13                  ${d}G = (${s}G * ${d}G) / 255;
   19.14                  ${d}B = (${s}B * ${d}B) / 255;
   19.15                  break;
   19.16 +            case SDL_COPY_MUL:
   19.17 +__EOF__
   19.18 +        if ($A_is_const_FF) {
   19.19 +            print FILE <<__EOF__;
   19.20 +                ${d}R = (${s}R * ${d}R) / 255;
   19.21 +                ${d}G = (${s}G * ${d}G) / 255;
   19.22 +                ${d}B = (${s}B * ${d}B) / 255;
   19.23 +__EOF__
   19.24 +        } else {
   19.25 +            print FILE <<__EOF__;
   19.26 +                ${d}R = ((${s}R * ${d}R) + (${d}R * (255 - ${s}A))) / 255; if (${d}R > 255) ${d}R = 255;
   19.27 +                ${d}G = ((${s}G * ${d}G) + (${d}G * (255 - ${s}A))) / 255; if (${d}G > 255) ${d}G = 255;
   19.28 +                ${d}B = ((${s}B * ${d}B) + (${d}B * (255 - ${s}A))) / 255; if (${d}B > 255) ${d}B = 255;
   19.29 +__EOF__
   19.30 +        }
   19.31 +        if ( $dst_has_alpha ) {
   19.32 +            if ($A_is_const_FF) {
   19.33 +                print FILE <<__EOF__;
   19.34 +                ${d}A = 0xFF;
   19.35 +__EOF__
   19.36 +            } else {
   19.37 +                print FILE <<__EOF__;
   19.38 +                ${d}A = ((${s}A * ${d}A) + (${d}A * (255 - ${s}A))) / 255; if (${d}A > 255) ${d}A = 255;
   19.39 +__EOF__
   19.40 +            }
   19.41 +        }
   19.42 +
   19.43 +        print FILE <<__EOF__;
   19.44 +                break;
   19.45              }
   19.46  __EOF__
   19.47      }
   19.48 @@ -524,7 +553,7 @@
   19.49                                  }
   19.50                              }
   19.51                              if ( $blend ) {
   19.52 -                                $flag = "SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD";
   19.53 +                                $flag = "SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL";
   19.54                                  if ( $flags eq "" ) {
   19.55                                      $flags = $flag;
   19.56                                  } else {