rem: initUnsignedTable(audioctrl, AHIBase))
add: initUnsignedTable( audioctrl ) )
context: LoadSound ( REG(d0, UWORD sound),            REG(d1, ULONG type),            REG(a0, APTR info),            REG(a2, struct AHIPrivAudioCtrl *audioctrl),            REG(a6, struct AHIBase *AHIBase) ){  struct Library *AHIsubBase;  ULONG rc;  if(AHIBase->ahib_DebugLevel >= AHI_DEBUG_LOW)  {    Debug_LoadSound(sound, type, info, audioctrl);  }  AHIsubBase = audioctrl->ahiac_SubLib;  rc = AHIsub_LoadSound(sound, type, info, (struct AHIAudioCtrlDrv *) audioctrl);  if((audioctrl->ac.ahiac_Flags & AHIACF_NOMIXING) || (rc != AHIS_UNKNOWN))  {    return rc;  }  rc = AHIE_OK;  switch(type)  {    case AHIST_DYNAMICSAMPLE:    case AHIST_SAMPLE:    {      struct AHISampleInfo *si = (struct AHISampleInfo *) info;            switch(si->ahisi_Type)      {        case AHIST_M8S:        case AHIST_M16S:#ifdef _M68020        case AHIST_S8S:        case AHIST_S16S:#endif          /* AHI_FreeAudio() will deallocate...  */          if(initSignedTable(audioctrl, AHIBase))          {            audioctrl->ahiac_SoundDatas[sound].sd_Type   = si->ahisi_Type;            audioctrl->ahiac_SoundDatas[sound].sd_Addr   = si->ahisi_Address;            audioctrl->ahiac_SoundDatas[sound].sd_Length = si->ahisi_Length;          }          else rc = AHIE_NOMEM;          break;        /* Obsolete, present for compability only. FIXIT! */        case AHIST_M8U:          /* AHI_FreeAudio() will deallocate...  */          if( ((audioctrl->ac.ahiac_Flags & AHIACF_HIFI) == 0) &&               initUnsignedTable(audioctrl, AHIBase))          {            audioctrl->ahiac_SoundDatas[sound].sd_Type   = si->ahisi_Type;            audioctrl->ahiac_SoundDatas[sound].sd_Addr   = si->ahisi_Address;            audioctrl->ahiac_SoundDatas[sound].sd_Length = si->ahisi_Length;          }          else rc = AHIE_NOMEM;          break;        default:          rc = AHIE_BADSAMPLETYPE;      }            break;    }     case AHIST_INPUT:    {      if(audioctrl->ahiac_InputBuffer[0] == NULL)      {        ULONG playsamples = 0, recordsamples = 0;        if(AHI_GetAudioAttrs( AHI_INVALID_ID, (struct AHIAudioCtrl *) audioctrl,            AHIDB_MaxPlaySamples,   (ULONG) &playsamples,            AHIDB_MaxRecordSamples, (ULONG) &recordsamples,            TAG_DONE))        {          audioctrl->ahiac_InputBlockLength = recordsamples;          audioctrl->ahiac_InputLength      = recordsamples;          while(audioctrl->ahiac_InputLength < playsamples)          {            audioctrl->ahiac_InputLength += recordsamples;          }          /* AHI_FreeAudio() will deallocate...  */          audioctrl->ahiac_InputBuffer[0] = AllocVec(              audioctrl->ahiac_InputLength * AHI_SampleFrameSize(AHIST_S16S),              MEMF_PUBLIC|MEMF_CLEAR);          audioctrl->ahiac_InputBuffer[1] = AllocVec(              audioctrl->ahiac_InputLength * AHI_SampleFrameSize(AHIST_S16S),              MEMF_PUBLIC|MEMF_CLEAR);          audioctrl->ahiac_InputBuffer[2] = AllocVec(              audioctrl->ahiac_InputLength * AHI_SampleFrameSize(AHIST_S16S),              MEMF_PUBLIC|MEMF_CLEAR);/*          KPrintF("Buffer0: %lx, length %ld\n",audioctrl->ahiac_InputBuffer[0], audioctrl->ahiac_InputLength);          KPrintF("Buffer1: %lx, length %ld\n",audioctrl->ahiac_InputBuffer[1], audioctrl->ahiac_InputLength);          KPrintF("Buffer2: %lx, length %ld\n",audioctrl->ahiac_InputBuffer[2], audioctrl->ahiac_InputLength);*/          if((audioctrl->ahiac_InputBuffer[0] != NULL) &&             (audioctrl->ahiac_InputBuffer[1] != NULL) &&             (audioctrl->ahiac_InputBuffer[2] != NULL))          {            audioctrl->ahiac_InputRecordPtr = audioctrl->ahiac_InputBuffer[0];            audioctrl->ahiac_InputRecordCnt = audioctrl->ahiac_InputLength;            audioctrl->ahiac_SoundDatas[sound].sd_Type = AHIST_INPUT|AHIST_S16S;            audioctrl->ahiac_SoundDatas[sound].sd_InputBuffer[0] =                audioctrl->ahiac_InputBuffer[0];            audioctrl->ahiac_SoundDatas[sound].sd_InputBuffer[1] =                audioctrl->ahiac_InputBuffer[1];            audioctrl->ahiac_SoundDatas[sound].sd_InputBuffer[2] =                audioctrl->ahiac_InputBuffer[2];            /* See also: AHI_SetSound() */          }          else          {            FreeVec(audioctrl->ahiac_InputBuffer[0]);            FreeVec(audioctrl->ahiac_InputBuffer[1]);            FreeVec(audioctrl->ahiac_InputBuffer[2]);            audioctrl->ahiac_InputBuffer[0] = NULL;            audioctrl->ahiac_InputBuffer[1] = NULL;            audioctrl->ahiac_InputBuffer[2] = NULL;            rc = AHIE_NOMEM;          }        }        else rc = AHIE_UNKNOWN;      }      break;    }    default:      rc = AHIE_BADSOUNDTYPE;      break;  }  if(AHIBase->ahib_DebugLevel >= AHI_DEBUG_LOW)  {    KPrintF("=>%ld\n", rc);  }  return rc;}