int sm = s >> 24; int dm = d >> 24;
void doDMA(u32 &s, u32 &d, u32 si, u32 di, u32 c, int transfer32){  //  int sm = s >> 24;  //  int dm = d >> 24;  int sc = c;  cpuDmaCount = c;    if(transfer32) {    s &= 0xFFFFFFFC;    if(s < 0x02000000 && (reg[15].I >> 24)) {      while(c != 0) {        CPUWriteMemory(d, 0);        d += di;        c--;      }    } else {      while(c != 0) {        CPUWriteMemory(d, CPUReadMemory(s));        d += di;        s += si;        c--;      }    }  } else {    s &= 0xFFFFFFFE;    si = (int)si >> 1;    di = (int)di >> 1;    if(s < 0x02000000 && (reg[15].I >> 24)) {      while(c != 0) {        CPUWriteHalfWord(d, 0);        d += di;        c--;      }    } else {      while(c != 0) {        CPUWriteHalfWord(d, CPUReadHalfWord(s));        d += di;        s += si;        c--;      }    }  }  cpuDmaCount = 0;    //  int sw = 1+memoryWait[sm & 15];  //  int dw = 1+memoryWait[dm & 15];  //  int totalTicks = 0;    //  if(transfer32) {  //    if(!memory32[sm & 15])  //      sw <<= 1;  //    if(!memory32[dm & 15])  //      dw <<= 1;  //  }    //  totalTicks = (sw+dw)*sc;  int totalTicks = (transfer32 ? 3 : 2) * sc;  cpuDmaTicksToUpdate += totalTicks;  if(*extCpuLoopTicks >= 0) {    CPU_BREAK_LOOP;  }}