| 1316 | } |
| 1317 | |
| 1318 | void GSState::DumpTransferImages() |
| 1319 | { |
| 1320 | // Only create the file if there are transfers to dump |
| 1321 | std::optional<std::ofstream> file; |
| 1322 | |
| 1323 | int transfer_n = 0; |
| 1324 | for (int i = 0; i < static_cast<int>(m_draw_transfers.size()); ++i) |
| 1325 | { |
| 1326 | if (m_draw_transfers[i].draw != s_n - 1) |
| 1327 | continue; // skip transfers that did not start in the previous draw |
| 1328 | |
| 1329 | const GSUploadQueue& transfer = m_draw_transfers[i]; |
| 1330 | |
| 1331 | std::string filename; |
| 1332 | if ((transfer.transfer_type == EEGS_TransferType::EE_to_GS) || transfer.transfer_type == EEGS_TransferType::Clear) |
| 1333 | { |
| 1334 | // clear or EE->GS: only the destination info is relevant. |
| 1335 | filename = GetDrawDumpPath("%05lld_transfer%02d_%s_%04x_%d_%s_%d_%d_%d_%d.png", |
| 1336 | s_n, transfer_n++, ((transfer.transfer_type == EEGS_TransferType::Clear) ? "clear" : "EE_to_GS"), transfer.blit.DBP, transfer.blit.DBW, |
| 1337 | GSUtil::GetPSMName(transfer.blit.DPSM), transfer.rect.x, transfer.rect.y, transfer.rect.z, transfer.rect.w); |
| 1338 | } |
| 1339 | else |
| 1340 | { |
| 1341 | // GS->GS: the source and destination info are both relevant. |
| 1342 | filename = GetDrawDumpPath("%05lld_transfer%02d_GS_to_GS_%04x_%d_%s_%04x_%d_%s_%d_%d_%d_%d.bmp", |
| 1343 | s_n, transfer_n++, transfer.blit.SBP, transfer.blit.SBW, GSUtil::GetPSMName(transfer.blit.SPSM), |
| 1344 | transfer.blit.DBP, transfer.blit.DBW, GSUtil::GetPSMName(transfer.blit.DPSM), |
| 1345 | transfer.rect.x, transfer.rect.y, transfer.rect.z, transfer.rect.w); |
| 1346 | } |
| 1347 | |
| 1348 | m_mem.SaveBMP(filename, transfer.blit.DBP, transfer.blit.DBW, transfer.blit.DPSM, |
| 1349 | transfer.rect.width(), transfer.rect.height(), transfer.rect.x, transfer.rect.y); |
| 1350 | } |
| 1351 | } |
| 1352 | |
| 1353 | __inline void GSState::CheckFlushes() |
| 1354 | { |