rem: case AHIST_M32S:
add: case AHIST_M16S:
context: SelectAddRoutine ( Fixed     VolumeLeft,                   Fixed     VolumeRight,                   ULONG     SampleType,                   struct    AHIPrivAudioCtrl *audioctrl,                   LONG     *ScaleLeft,                   LONG     *ScaleRight,                   ADDFUNC **AddRoutine ){  // This version only cares about the sample format and does not use any  // optimized add-routines.  // Scale the volume  VolumeLeft  = VolumeLeft  * (audioctrl->ahiac_MasterVolume >> 8) /                               (audioctrl->ahiac_Channels2 << 8);  VolumeRight = VolumeRight * (audioctrl->ahiac_MasterVolume >> 8) /                               (audioctrl->ahiac_Channels2 << 8);  // First, select HiFi or LoFi...  if( audioctrl->ac.ahiac_Flags & AHIACF_HIFI )  {    // Then, check the output format...    switch(audioctrl->ac.ahiac_BuffType)    {      case AHIST_M32S:        // ...and then the source format.        switch(SampleType)        {          case AHIST_M8S:          case AHIST_BW|AHIST_M8S:            *ScaleLeft  = VolumeLeft + VolumeRight;            *ScaleRight = 0;            if(SampleType & AHIST_BW)              *AddRoutine = AddByteMonoBPtr;            else              *AddRoutine = AddByteMonoPtr;            break;          case AHIST_S8S:          case AHIST_BW|AHIST_S8S:            *ScaleLeft  = VolumeLeft;            *ScaleRight = VolumeRight;            if(SampleType & AHIST_BW)              *AddRoutine = AddBytesMonoBPtr;            else              *AddRoutine = AddBytesMonoPtr;            break;          case AHIST_M16S:          case AHIST_BW|AHIST_M16S:            *ScaleLeft  = VolumeLeft + VolumeRight;            *ScaleRight = 0;            if(SampleType & AHIST_BW)              *AddRoutine = AddWordMonoBPtr;            else              *AddRoutine = AddWordMonoPtr;            break;          case AHIST_S16S:          case AHIST_BW|AHIST_S16S:            *ScaleLeft  = VolumeLeft;            *ScaleRight = VolumeRight;            if(SampleType & AHIST_BW)              *AddRoutine = AddWordsMonoBPtr;            else              *AddRoutine = AddWordsMonoPtr;            break;          default:            *ScaleLeft  = 0;            *ScaleRight = 0;            *AddRoutine = NULL;            break;        }        break;      case AHIST_S32S:        // ...and then the source format.        switch(SampleType)        {          case AHIST_M8S:          case AHIST_BW|AHIST_M8S:            *ScaleLeft  = VolumeLeft;            *ScaleRight = VolumeRight;            if(SampleType & AHIST_BW)              *AddRoutine = AddByteStereoBPtr;            else              *AddRoutine = AddByteStereoPtr;            break;          case AHIST_S8S:          case AHIST_BW|AHIST_S8S:            *ScaleLeft  = VolumeLeft;            *ScaleRight = VolumeRight;            if(SampleType & AHIST_BW)              *AddRoutine = AddBytesStereoBPtr;            else              *AddRoutine = AddBytesStereoPtr;            break;          case AHIST_M16S:          case AHIST_BW|AHIST_M16S:            *ScaleLeft  = VolumeLeft;            *ScaleRight = VolumeRight;            if(SampleType & AHIST_BW)              *AddRoutine = AddWordStereoBPtr;            else              *AddRoutine = AddWordStereoPtr;            break;          case AHIST_S16S:          case AHIST_BW|AHIST_S16S:            *ScaleLeft  = VolumeLeft;            *ScaleRight = VolumeRight;            if(SampleType & AHIST_BW)              *AddRoutine = AddWordsStereoBPtr;            else              *AddRoutine = AddWordsStereoPtr;            break;          default:            *ScaleLeft  = 0;            *ScaleRight = 0;            *AddRoutine = NULL;            break;        }        break;      default:        *ScaleLeft  = 0;        *ScaleRight = 0;        *AddRoutine = NULL;        break;    }  }  else  {    // Then, check the output format...    switch(audioctrl->ac.ahiac_BuffType)    {      case AHIST_M32S:        // ...and then the source format.        switch(SampleType)        {          case AHIST_M8S:          case AHIST_BW|AHIST_M8S:            *ScaleLeft  = VolumeLeft + VolumeRight;            *ScaleRight = 0;            if(SampleType & AHIST_BW)              *AddRoutine = AddLofiByteMonoBPtr;            else              *AddRoutine = AddLofiByteMonoPtr;            break;          case AHIST_S8S:          case AHIST_BW|AHIST_S8S:            *ScaleLeft  = VolumeLeft;            *ScaleRight = VolumeRight;            if(SampleType & AHIST_BW)              *AddRoutine = AddLofiBytesMonoBPtr;            else              *AddRoutine = AddLofiBytesMonoPtr;            break;          case AHIST_M16S:          case AHIST_BW|AHIST_M16S:            *ScaleLeft  = VolumeLeft + VolumeRight;            *ScaleRight = 0;            if(SampleType & AHIST_BW)              *AddRoutine = AddLofiWordMonoBPtr;            else              *AddRoutine = AddLofiWordMonoPtr;            break;          case AHIST_S16S:          case AHIST_BW|AHIST_S16S:            *ScaleLeft  = VolumeLeft;            *ScaleRight = VolumeRight;            if(SampleType & AHIST_BW)              *AddRoutine = AddLofiWordsMonoBPtr;            else              *AddRoutine = AddLofiWordsMonoPtr;            break;          default:            *ScaleLeft  = 0;            *ScaleRight = 0;            *AddRoutine = NULL;            break;        }        break;      case AHIST_S32S:        // ...and then the source format.        switch(SampleType)        {          case AHIST_M8S:          case AHIST_BW|AHIST_M8S:            *ScaleLeft  = VolumeLeft;            *ScaleRight = VolumeRight;            if(SampleType & AHIST_BW)              *AddRoutine = AddLofiByteStereoBPtr;            else              *AddRoutine = AddLofiByteStereoPtr;            break;          case AHIST_S8S:          case AHIST_BW|AHIST_S8S:            *ScaleLeft  = VolumeLeft;            *ScaleRight = VolumeRight;            if(SampleType & AHIST_BW)              *AddRoutine = AddLofiBytesStereoBPtr;            else              *AddRoutine = AddLofiBytesStereoPtr;            break;          case AHIST_M16S:          case AHIST_BW|AHIST_M16S:            *ScaleLeft  = VolumeLeft;            *ScaleRight = VolumeRight;            if(SampleType & AHIST_BW)              *AddRoutine = AddLofiWordStereoBPtr;            else              *AddRoutine = AddLofiWordStereoPtr;            break;          case AHIST_S16S:          case AHIST_BW|AHIST_S16S:            *ScaleLeft  = VolumeLeft;            *ScaleRight = VolumeRight;            if(SampleType & AHIST_BW)              *AddRoutine = AddLofiWordsStereoBPtr;            else              *AddRoutine = AddLofiWordsStereoPtr;            break;          default:            *ScaleLeft  = 0;            *ScaleRight = 0;            *AddRoutine = NULL;            break;        }        break;      default:        *ScaleLeft  = 0;        *ScaleRight = 0;        *AddRoutine = NULL;        break;    }  }}