MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / SIF0Dma

Function SIF0Dma

pcsx2/Sif0.cpp:293–329  ·  view source on GitHub ↗

Transfer IOP to EE, putting data in the fifo as an intermediate step.

Source from the content-addressed store, hash-verified

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{

Callers 2

psxDma9Function · 0.85
dmaSIF0Function · 0.85

Calls 6

Sif0InitFunction · 0.85
Sif0EndFunction · 0.85
sif_freeMethod · 0.80
writeJunkMethod · 0.80
HandleIOPTransferFunction · 0.70
HandleEETransferFunction · 0.70

Tested by

no test coverage detected