| 301 | } |
| 302 | |
| 303 | static u32 WRITERING_DMA(u32* pMem, u32 qwc) |
| 304 | { |
| 305 | const u32 originalQwc = qwc; |
| 306 | |
| 307 | if (gifRegs.stat.IMT) |
| 308 | { |
| 309 | // Splitting by 8qw can be really slow, so on bigger packets be less picky. |
| 310 | // Games seem to be more concerned with other channels finishing before PATH 3 finishes |
| 311 | // so we can get away with transferring "most" of it when it's a big packet. |
| 312 | // Use Wallace and Gromit Project Zoo or The Suffering for testing |
| 313 | if (qwc > 64) |
| 314 | qwc = qwc * 0.5f; |
| 315 | else |
| 316 | qwc = std::min(qwc, 8u); |
| 317 | } |
| 318 | // If the packet is larger than 8qw, try to time the packet somewhat so any "finish" signals don't fire way too early and GIF syncs with other units. |
| 319 | // (Mana Khemia exhibits flickering characters without). |
| 320 | else if (qwc > 8) |
| 321 | qwc -= 8; |
| 322 | |
| 323 | uint size; |
| 324 | |
| 325 | if (CheckPaths() == false || ((qwc < 8 || gif_fifo.fifoSize > 0) && CHECK_GIFFIFOHACK)) |
| 326 | { |
| 327 | if (gif_fifo.fifoSize < 16) |
| 328 | { |
| 329 | size = gif_fifo.write_fifo((u32*)pMem, originalQwc); // Use original QWC here, the intermediate mode is for the GIF unit, not DMA |
| 330 | incGifChAddr(size); |
| 331 | return size; |
| 332 | } |
| 333 | return 4; // Arbitrary value, probably won't schedule a DMA anwyay since the FIFO is full and GIF is paused |
| 334 | } |
| 335 | |
| 336 | size = gifUnit.TransferGSPacketData(GIF_TRANS_DMA, (u8*)pMem, qwc * 16) / 16; |
| 337 | incGifChAddr(size); |
| 338 | return size; |
| 339 | } |
| 340 | |
| 341 | static __fi void GIFchain() |
| 342 | { |
no test coverage detected