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

Function gifCheckPathStatus

pcsx2/Gif.cpp:168–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168__fi void gifCheckPathStatus(bool calledFromGIF)
169{
170 // If GIF is running on it's own, let it handle its own timing.
171 if (calledFromGIF && gifch.chcr.STR)
172 {
173 if (gif_fifo.fifoSize == 16)
174 GifDMAInt(16);
175 return;
176 }
177
178 // Required for Path3 Masking timing!
179 if (gifUnit.gifPath[GIF_PATH_3].state == GIF_PATH_WAIT)
180 gifUnit.gifPath[GIF_PATH_3].state = GIF_PATH_IDLE;
181
182 if (gifRegs.stat.APATH == 3)
183 {
184 gifRegs.stat.APATH = 0;
185 gifRegs.stat.OPH = 0;
186
187 if (!calledFromGIF && (gifUnit.gifPath[GIF_PATH_3].state == GIF_PATH_IDLE || gifUnit.gifPath[GIF_PATH_3].state == GIF_PATH_WAIT))
188 {
189 if (gifUnit.checkPaths(1, 1, 0))
190 gifUnit.Execute(false, true);
191 }
192 }
193
194 // GIF DMA isn't running but VIF might be waiting on PATH3 so resume it here
195 if (calledFromGIF && gifUnit.gifPath[GIF_PATH_3].state == GIF_PATH_IDLE)
196 {
197 if (vif1Regs.stat.VGW)
198 {
199 // Check if VIF is in a cycle or is currently "idle" waiting for GIF to come back.
200 if (!(cpuRegs.interrupt & (1 << DMAC_VIF1)))
201 CPU_INT(DMAC_VIF1, 1);
202
203 // Make sure it loops if the GIF packet is empty to prepare for the next packet
204 // or end if it was the end of a packet.
205 // This must trigger after VIF retriggers as VIf might instantly mask Path3
206 if ((!gifUnit.Path3Masked() || gifch.qwc == 0) && (gifch.chcr.STR || gif_fifo.fifoSize))
207 {
208 GifDMAInt(16);
209 }
210 }
211 }
212}
213
214__fi void gifInterrupt()
215{

Callers 3

ExecuteMethod · 0.85
gifInterruptFunction · 0.85
gifMFIFOInterruptFunction · 0.85

Calls 5

GifDMAIntFunction · 0.85
CPU_INTFunction · 0.85
checkPathsMethod · 0.80
Path3MaskedMethod · 0.80
ExecuteMethod · 0.45

Tested by

no test coverage detected