Implemented S32LSB, S32MSB, and F32SYS versions of the effect position code
authorSam Lantinga <slouken@libsdl.org>
Sat, 23 Sep 2017 00:06:14 -0700
changeset 737d3fa63933df2
parent 736 f04d39d0b63c
child 738 e6fa426a79dd
Implemented S32LSB, S32MSB, and F32SYS versions of the effect position code
effect_position.c
     1.1 --- a/effect_position.c	Mon Sep 18 16:05:46 2017 -0700
     1.2 +++ b/effect_position.c	Sat Sep 23 00:06:14 2017 -0700
     1.3 @@ -1130,6 +1130,361 @@
     1.4      }
     1.5  }
     1.6  
     1.7 +static void _Eff_position_s32lsb(int chan, void *stream, int len, void *udata)
     1.8 +{
     1.9 +    /* 32 signed bits (lsb) * 2 channels. */
    1.10 +    volatile position_args *args = (volatile position_args *) udata;
    1.11 +    Sint32 *ptr = (Sint32 *) stream;
    1.12 +    int i;
    1.13 +
    1.14 +#if 0
    1.15 +    if (len % (sizeof(Sint32) * 2)) {
    1.16 +        fprintf(stderr,"Not an even number of frames! len=%d\n", len);
    1.17 +        return;
    1.18 +    }
    1.19 +#endif
    1.20 +
    1.21 +    for (i = 0; i < len; i += sizeof (Sint32) * 2) {
    1.22 +        Sint32 swapl = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+0))) *
    1.23 +                                    args->left_f) * args->distance_f);
    1.24 +        Sint32 swapr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+1))) *
    1.25 +                                    args->right_f) * args->distance_f);
    1.26 +    if (args->room_angle == 180) {
    1.27 +            *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
    1.28 +            *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
    1.29 +    }
    1.30 +    else {
    1.31 +            *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
    1.32 +            *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
    1.33 +    }
    1.34 +    }
    1.35 +}
    1.36 +static void _Eff_position_s32lsb_c4(int chan, void *stream, int len, void *udata)
    1.37 +{
    1.38 +    /* 32 signed bits (lsb) * 4 channels. */
    1.39 +    volatile position_args *args = (volatile position_args *) udata;
    1.40 +    Sint32 *ptr = (Sint32 *) stream;
    1.41 +    int i;
    1.42 +
    1.43 +    for (i = 0; i < len; i += sizeof (Sint32) * 4) {
    1.44 +        Sint32 swapl = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+0))) *
    1.45 +                                    args->left_f) * args->distance_f);
    1.46 +        Sint32 swapr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+1))) *
    1.47 +                                    args->right_f) * args->distance_f);
    1.48 +        Sint32 swaplr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+1))) *
    1.49 +                                    args->left_rear_f) * args->distance_f);
    1.50 +        Sint32 swaprr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+2))) *
    1.51 +                                    args->right_rear_f) * args->distance_f);
    1.52 +    switch (args->room_angle) {
    1.53 +        case 0:
    1.54 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
    1.55 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
    1.56 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
    1.57 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
    1.58 +            break;
    1.59 +        case 90:
    1.60 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
    1.61 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
    1.62 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
    1.63 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
    1.64 +            break;
    1.65 +        case 180:
    1.66 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
    1.67 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
    1.68 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
    1.69 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
    1.70 +            break;
    1.71 +        case 270:
    1.72 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
    1.73 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
    1.74 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
    1.75 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
    1.76 +            break;
    1.77 +    }
    1.78 +    }
    1.79 +}
    1.80 +
    1.81 +static void _Eff_position_s32lsb_c6(int chan, void *stream, int len, void *udata)
    1.82 +{
    1.83 +    /* 32 signed bits (lsb) * 6 channels. */
    1.84 +    volatile position_args *args = (volatile position_args *) udata;
    1.85 +    Sint32 *ptr = (Sint32 *) stream;
    1.86 +    int i;
    1.87 +
    1.88 +    for (i = 0; i < len; i += sizeof (Sint32) * 6) {
    1.89 +        Sint32 swapl = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+0))) *
    1.90 +                                    args->left_f) * args->distance_f);
    1.91 +        Sint32 swapr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+1))) *
    1.92 +                                    args->right_f) * args->distance_f);
    1.93 +        Sint32 swaplr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+2))) *
    1.94 +                                    args->left_rear_f) * args->distance_f);
    1.95 +        Sint32 swaprr = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+3))) *
    1.96 +                                    args->right_rear_f) * args->distance_f);
    1.97 +        Sint32 swapce = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+4))) *
    1.98 +                                    args->center_f) * args->distance_f);
    1.99 +        Sint32 swapwf = (Sint32) ((((float) (Sint32) SDL_SwapLE32(*(ptr+5))) *
   1.100 +                                    args->lfe_f) * args->distance_f);
   1.101 +    switch (args->room_angle) {
   1.102 +        case 0:
   1.103 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
   1.104 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
   1.105 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
   1.106 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
   1.107 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapce);
   1.108 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapwf);
   1.109 +            break;
   1.110 +        case 90:
   1.111 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
   1.112 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
   1.113 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
   1.114 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
   1.115 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapr)/2 + (Sint32) SDL_SwapLE32(swaprr)/2;
   1.116 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapwf);
   1.117 +            break;
   1.118 +        case 180:
   1.119 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
   1.120 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
   1.121 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
   1.122 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
   1.123 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaprr)/2 + (Sint32) SDL_SwapLE32(swaplr)/2;
   1.124 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapwf);
   1.125 +            break;
   1.126 +        case 270:
   1.127 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaplr);
   1.128 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapl);
   1.129 +                *(ptr++) = (Sint32) SDL_SwapLE32(swaprr);
   1.130 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapr);
   1.131 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapl)/2 + (Sint32) SDL_SwapLE32(swaplr)/2;
   1.132 +                *(ptr++) = (Sint32) SDL_SwapLE32(swapwf);
   1.133 +            break;
   1.134 +    }
   1.135 +    }
   1.136 +}
   1.137 +
   1.138 +static void _Eff_position_s32msb(int chan, void *stream, int len, void *udata)
   1.139 +{
   1.140 +    /* 32 signed bits (lsb) * 2 channels. */
   1.141 +    volatile position_args *args = (volatile position_args *) udata;
   1.142 +    Sint32 *ptr = (Sint32 *) stream;
   1.143 +    int i;
   1.144 +
   1.145 +    for (i = 0; i < len; i += sizeof (Sint32) * 2) {
   1.146 +        Sint32 swapl = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+0))) *
   1.147 +                                    args->left_f) * args->distance_f);
   1.148 +        Sint32 swapr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+1))) *
   1.149 +                                    args->right_f) * args->distance_f);
   1.150 +        *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
   1.151 +        *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
   1.152 +    }
   1.153 +}
   1.154 +static void _Eff_position_s32msb_c4(int chan, void *stream, int len, void *udata)
   1.155 +{
   1.156 +    /* 32 signed bits (lsb) * 4 channels. */
   1.157 +    volatile position_args *args = (volatile position_args *) udata;
   1.158 +    Sint32 *ptr = (Sint32 *) stream;
   1.159 +    int i;
   1.160 +
   1.161 +    for (i = 0; i < len; i += sizeof (Sint32) * 4) {
   1.162 +        Sint32 swapl = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+0))) *
   1.163 +                                    args->left_f) * args->distance_f);
   1.164 +        Sint32 swapr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+1))) *
   1.165 +                                    args->right_f) * args->distance_f);
   1.166 +        Sint32 swaplr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+2))) *
   1.167 +                                    args->left_rear_f) * args->distance_f);
   1.168 +        Sint32 swaprr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+3))) *
   1.169 +                                    args->right_rear_f) * args->distance_f);
   1.170 +    switch (args->room_angle) {
   1.171 +        case 0:
   1.172 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
   1.173 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
   1.174 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
   1.175 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
   1.176 +            break;
   1.177 +        case 90:
   1.178 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
   1.179 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
   1.180 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
   1.181 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
   1.182 +            break;
   1.183 +        case 180:
   1.184 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
   1.185 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
   1.186 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
   1.187 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
   1.188 +            break;
   1.189 +        case 270:
   1.190 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
   1.191 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
   1.192 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
   1.193 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
   1.194 +            break;
   1.195 +    }
   1.196 +    }
   1.197 +}
   1.198 +static void _Eff_position_s32msb_c6(int chan, void *stream, int len, void *udata)
   1.199 +{
   1.200 +    /* 32 signed bits (lsb) * 6 channels. */
   1.201 +    volatile position_args *args = (volatile position_args *) udata;
   1.202 +    Sint32 *ptr = (Sint32 *) stream;
   1.203 +    int i;
   1.204 +
   1.205 +    for (i = 0; i < len; i += sizeof (Sint32) * 6) {
   1.206 +        Sint32 swapl = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+0))) *
   1.207 +                                    args->left_f) * args->distance_f);
   1.208 +        Sint32 swapr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+1))) *
   1.209 +                                    args->right_f) * args->distance_f);
   1.210 +        Sint32 swaplr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+2))) *
   1.211 +                                    args->left_rear_f) * args->distance_f);
   1.212 +        Sint32 swaprr = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+3))) *
   1.213 +                                    args->right_rear_f) * args->distance_f);
   1.214 +        Sint32 swapce = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+4))) *
   1.215 +                                    args->center_f) * args->distance_f);
   1.216 +        Sint32 swapwf = (Sint32) ((((float) (Sint32) SDL_SwapBE32(*(ptr+5))) *
   1.217 +                                    args->lfe_f) * args->distance_f);
   1.218 +
   1.219 +    switch (args->room_angle) {
   1.220 +        case 0:
   1.221 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
   1.222 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
   1.223 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
   1.224 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
   1.225 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapce);
   1.226 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapwf);
   1.227 +            break;
   1.228 +        case 90:
   1.229 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
   1.230 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
   1.231 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
   1.232 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
   1.233 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapr)/2 + (Sint32) SDL_SwapBE32(swaprr)/2;
   1.234 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapwf);
   1.235 +            break;
   1.236 +        case 180:
   1.237 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
   1.238 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
   1.239 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
   1.240 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
   1.241 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaprr)/2 + (Sint32) SDL_SwapBE32(swaplr)/2;
   1.242 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapwf);
   1.243 +            break;
   1.244 +        case 270:
   1.245 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaplr);
   1.246 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapl);
   1.247 +                *(ptr++) = (Sint32) SDL_SwapBE32(swaprr);
   1.248 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapr);
   1.249 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapl)/2 + (Sint32) SDL_SwapBE32(swaplr)/2;
   1.250 +                *(ptr++) = (Sint32) SDL_SwapBE32(swapwf);
   1.251 +            break;
   1.252 +    }
   1.253 +    }
   1.254 +}
   1.255 +
   1.256 +static void _Eff_position_f32sys(int chan, void *stream, int len, void *udata)
   1.257 +{
   1.258 +    /* float * 2 channels. */
   1.259 +    volatile position_args *args = (volatile position_args *) udata;
   1.260 +    float *ptr = (float *) stream;
   1.261 +    int i;
   1.262 +
   1.263 +    for (i = 0; i < len; i += sizeof (float) * 2) {
   1.264 +        float swapl = ((*(ptr+0) * args->left_f) * args->distance_f);
   1.265 +        float swapr = ((*(ptr+1) * args->right_f) * args->distance_f);
   1.266 +        *(ptr++) = swapl;
   1.267 +        *(ptr++) = swapr;
   1.268 +    }
   1.269 +}
   1.270 +static void _Eff_position_f32sys_c4(int chan, void *stream, int len, void *udata)
   1.271 +{
   1.272 +    /* float * 4 channels. */
   1.273 +    volatile position_args *args = (volatile position_args *) udata;
   1.274 +    float *ptr = (float *) stream;
   1.275 +    int i;
   1.276 +
   1.277 +    for (i = 0; i < len; i += sizeof (float) * 4) {
   1.278 +        float swapl = ((*(ptr+0) * args->left_f) * args->distance_f);
   1.279 +        float swapr = ((*(ptr+1) * args->right_f) * args->distance_f);
   1.280 +        float swaplr = ((*(ptr+2) * args->left_rear_f) * args->distance_f);
   1.281 +        float swaprr = ((*(ptr+3) * args->right_rear_f) * args->distance_f);
   1.282 +		switch (args->room_angle) {
   1.283 +        case 0:
   1.284 +                *(ptr++) = swapl;
   1.285 +                *(ptr++) = swapr;
   1.286 +                *(ptr++) = swaplr;
   1.287 +                *(ptr++) = swaprr;
   1.288 +            break;
   1.289 +        case 90:
   1.290 +                *(ptr++) = swapr;
   1.291 +                *(ptr++) = swaprr;
   1.292 +                *(ptr++) = swapl;
   1.293 +                *(ptr++) = swaplr;
   1.294 +            break;
   1.295 +        case 180:
   1.296 +                *(ptr++) = swaprr;
   1.297 +                *(ptr++) = swaplr;
   1.298 +                *(ptr++) = swapr;
   1.299 +                *(ptr++) = swapl;
   1.300 +            break;
   1.301 +        case 270:
   1.302 +                *(ptr++) = swaplr;
   1.303 +                *(ptr++) = swapl;
   1.304 +                *(ptr++) = swaprr;
   1.305 +                *(ptr++) = swapr;
   1.306 +            break;
   1.307 +		}
   1.308 +    }
   1.309 +}
   1.310 +static void _Eff_position_f32sys_c6(int chan, void *stream, int len, void *udata)
   1.311 +{
   1.312 +    /* float * 6 channels. */
   1.313 +    volatile position_args *args = (volatile position_args *) udata;
   1.314 +    float *ptr = (float *) stream;
   1.315 +    int i;
   1.316 +
   1.317 +    for (i = 0; i < len; i += sizeof (float) * 6) {
   1.318 +        float swapl = ((*(ptr+0) * args->left_f) * args->distance_f);
   1.319 +        float swapr = ((*(ptr+1) * args->right_f) * args->distance_f);
   1.320 +        float swaplr = ((*(ptr+2) * args->left_rear_f) * args->distance_f);
   1.321 +        float swaprr = ((*(ptr+3) * args->right_rear_f) * args->distance_f);
   1.322 +        float swapce = ((*(ptr+4) * args->center_f) * args->distance_f);
   1.323 +        float swapwf = ((*(ptr+5) * args->lfe_f) * args->distance_f);
   1.324 +
   1.325 +    switch (args->room_angle) {
   1.326 +        case 0:
   1.327 +                *(ptr++) = swapl;
   1.328 +                *(ptr++) = swapr;
   1.329 +                *(ptr++) = swaplr;
   1.330 +                *(ptr++) = swaprr;
   1.331 +                *(ptr++) = swapce;
   1.332 +                *(ptr++) = swapwf;
   1.333 +            break;
   1.334 +        case 90:
   1.335 +                *(ptr++) = swapr;
   1.336 +                *(ptr++) = swaprr;
   1.337 +                *(ptr++) = swapl;
   1.338 +                *(ptr++) = swaplr;
   1.339 +                *(ptr++) = swapr/2.0f + swaprr/2.0f;
   1.340 +                *(ptr++) = swapwf;
   1.341 +            break;
   1.342 +        case 180:
   1.343 +                *(ptr++) = swaprr;
   1.344 +                *(ptr++) = swaplr;
   1.345 +                *(ptr++) = swapr;
   1.346 +                *(ptr++) = swapl;
   1.347 +                *(ptr++) = swaprr/2.0f + swaplr/2.0f;
   1.348 +                *(ptr++) = swapwf;
   1.349 +            break;
   1.350 +        case 270:
   1.351 +                *(ptr++) = swaplr;
   1.352 +                *(ptr++) = swapl;
   1.353 +                *(ptr++) = swaprr;
   1.354 +                *(ptr++) = swapr;
   1.355 +                *(ptr++) = swapl/2.0f + swaplr/2.0f;
   1.356 +                *(ptr++) = swapwf;
   1.357 +            break;
   1.358 +    }
   1.359 +    }
   1.360 +}
   1.361 +
   1.362  static void init_position_args(position_args *args)
   1.363  {
   1.364      SDL_memset(args, '\0', sizeof (position_args));
   1.365 @@ -1302,6 +1657,60 @@
   1.366          }
   1.367          break;
   1.368  
   1.369 +        case AUDIO_S32MSB:
   1.370 +        switch (channels) {
   1.371 +            case 1:
   1.372 +            case 2:
   1.373 +                f = _Eff_position_s32msb;
   1.374 +                break;
   1.375 +            case 4:
   1.376 +                f = _Eff_position_s32msb_c4;
   1.377 +                break;
   1.378 +            case 6:
   1.379 +                f = _Eff_position_s32msb_c6;
   1.380 +                break;
   1.381 +            default:
   1.382 +                Mix_SetError("Unsupported audio channels");
   1.383 +                break;
   1.384 +        }
   1.385 +        break;
   1.386 +
   1.387 +        case AUDIO_S32LSB:
   1.388 +        switch (channels) {
   1.389 +            case 1:
   1.390 +            case 2:
   1.391 +                f = _Eff_position_s32lsb;
   1.392 +                break;
   1.393 +            case 4:
   1.394 +                f = _Eff_position_s32lsb_c4;
   1.395 +                break;
   1.396 +            case 6:
   1.397 +                f = _Eff_position_s32lsb_c6;
   1.398 +                break;
   1.399 +            default:
   1.400 +                Mix_SetError("Unsupported audio channels");
   1.401 +                break;
   1.402 +        }
   1.403 +        break;
   1.404 +
   1.405 +        case AUDIO_F32SYS:
   1.406 +        switch (channels) {
   1.407 +            case 1:
   1.408 +            case 2:
   1.409 +                f = _Eff_position_f32sys;
   1.410 +                break;
   1.411 +            case 4:
   1.412 +                f = _Eff_position_f32sys_c4;
   1.413 +                break;
   1.414 +            case 6:
   1.415 +                f = _Eff_position_f32sys_c6;
   1.416 +                break;
   1.417 +            default:
   1.418 +                Mix_SetError("Unsupported audio channels");
   1.419 +                break;
   1.420 +        }
   1.421 +        break;
   1.422 +
   1.423          default:
   1.424              Mix_SetError("Unsupported audio format");
   1.425              break;