// Handle the EE transfer. static __fi void HandleEETransfer() { if(sif0dma.chcr.STR == false) { //DevCon.Warning("Replacement for irq prevention hack EE SIF0"); sif0.ee.end = false; sif0.ee.busy = false; return; } if (dmacRegs.ctrl.STS == STS_SIF0) { DevCon.Warning("SIF0 stall control"); } /*if (sif0dma.qwc == 0) if (sif0dma.chcr.MOD == NORMAL_MODE) if (!sif0.ee.end){ DevCon.Warning("sif0 irq prevented"); done = true; return; }*/ if (sif0dma.qwc <= 0) { if ((sif0dma.chcr.MOD == NORMAL_MODE) || sif0.ee.end) { // Stop transferring ee, and signal an interrupt. done = true; EndEE(); } else if (sif0.fifo.size >= 4) // Read a tag { // Read Fifo into an ee tag, transfer it to sif0dma // and process it. ProcessEETag(); } } if (sif0dma.qwc > 0) // If we're writing something, continue to do so. { // Write from Fifo to EE. if (sif0.fifo.size > 0) { WriteFifoToEE(); } } }
// Handle the EE transfer. static __fi void HandleEETransfer() { if(sif1dma.chcr.STR == false) { //DevCon.Warning("Replacement for irq prevention hack EE SIF1"); sif1.ee.end = false; sif1.ee.busy = false; return; } if (dmacRegs.ctrl.STD == STD_SIF1) { DevCon.Warning("SIF1 stall control"); // STD == fromSIF1 } /*if (sif1dma.qwc == 0) if (sif1dma.chcr.MOD == NORMAL_MODE) if (!sif1.ee.end){ DevCon.Warning("sif1 irq prevented CHCR %x QWC %x", sif1dma.chcr, sif1dma.qwc); done = true; return; }*/ // If there's no more to transfer. if (sif1dma.qwc <= 0) { // If NORMAL mode or end of CHAIN then stop DMA. if ((sif1dma.chcr.MOD == NORMAL_MODE) || sif1.ee.end) { done = true; EndEE(); } else { done = false; if (!ProcessEETag()) return; } } else { if (sif1.fifo.sif_free() > 0) { WriteEEtoFifo(); } } }