rem: KPrintF("WriteCmd(0x%08lx)\n", ioreq);
add: if(AHIBase->ahib_DebugLevel >= AHI_DEBUG_HIGH) { KPrintF("CMD_WRITE\n"); }
context: static void WriteCmd(struct AHIRequest *ioreq, struct AHIBase *AHIBase){  struct AHIDevUnit *iounit;  ULONG error = 0;  KPrintF("WriteCmd(0x%08lx)\n", ioreq);  iounit = (struct AHIDevUnit *) ioreq->ahir_Std.io_Unit;  /* Start playback if neccessary */  if( ! iounit->IsPlaying)  {    if( (! iounit->FullDuplex) && iounit->IsRecording)    {      error = AHIE_UNKNOWN;   // FIXIT!    }    else    {      error = AHI_ControlAudio(iounit->AudioCtrl,         AHIC_Play,TRUE,         TAG_DONE);    }    if( ! error)    {      iounit->IsPlaying = TRUE;    }  }  if(iounit->IsPlaying)     // (error == 0)  {    ioreq->ahir_Std.io_Actual = 0;        switch(ioreq->ahir_Type)    {      case AHIST_M8S:        break;      case AHIST_M16S:        // Address to sample offset        ioreq->ahir_Std.io_Data = (APTR) ((ULONG) ioreq->ahir_Std.io_Data >> 1);        // Length in bytes to length in samples        ioreq->ahir_Std.io_Length >>= 1;        break;      case AHIST_S8S:      case AHIST_S16S:      case AHIST_M8U:      case AHIST_M32S:      case AHIST_S32S:      default:        error=AHIE_BADSAMPLETYPE;    }    if(! error)    {      NewWriter(ioreq, iounit, AHIBase);    }  }  if(error)  {    ioreq->ahir_Std.io_Error = error;    TermIO(ioreq, AHIBase);  }}