Transfer IOP to EE, putting data in the fifo as an intermediate step.
| 291 | |
| 292 | // Transfer IOP to EE, putting data in the fifo as an intermediate step. |
| 293 | __fi void SIF0Dma() |
| 294 | { |
| 295 | int BusyCheck = 0; |
| 296 | Sif0Init(); |
| 297 | |
| 298 | do |
| 299 | { |
| 300 | //I realise this is very hacky in a way but its an easy way of checking if both are doing something |
| 301 | BusyCheck = 0; |
| 302 | |
| 303 | if (sif0.iop.counter == 0 && sif0.iop.writeJunk && sif0.fifo.sif_free() >= sif0.iop.writeJunk) |
| 304 | { |
| 305 | SIF_LOG("Writing Junk %d", sif0.iop.writeJunk); |
| 306 | sif0.fifo.writeJunk(sif0.iop.writeJunk); |
| 307 | sif0.iop.writeJunk = 0; |
| 308 | } |
| 309 | |
| 310 | if (sif0.iop.busy) |
| 311 | { |
| 312 | if(sif0.fifo.sif_free() > 0 || (sif0.iop.end && sif0.iop.counter == 0)) |
| 313 | { |
| 314 | BusyCheck++; |
| 315 | HandleIOPTransfer(); |
| 316 | } |
| 317 | } |
| 318 | if (sif0.ee.busy) |
| 319 | { |
| 320 | if(sif0.fifo.size >= 4 || (sif0.ee.end && sif0ch.qwc == 0)) |
| 321 | { |
| 322 | BusyCheck++; |
| 323 | HandleEETransfer(); |
| 324 | } |
| 325 | } |
| 326 | } while (/*!done && */BusyCheck > 0); // Substituting (sif0.ee.busy || sif0.iop.busy) breaks things. |
| 327 | |
| 328 | Sif0End(); |
| 329 | } |
| 330 | |
| 331 | __fi void sif0Interrupt() |
| 332 | { |
no test coverage detected