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

Method EraseBlock

pcsx2/SIO/Memcard/MemoryCardFile.cpp:510–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

508}
509
510s32 FileMemoryCard::EraseBlock(uint slot, u32 adr)
511{
512 std::FILE* mcfp = m_file[slot];
513 if (!mcfp)
514 {
515 DevCon.Error("MemoryCard: Ignoring erase for disabled slot.");
516 return 1;
517 }
518
519 if (!Seek(mcfp, adr))
520 return 0;
521
522 u8 buf[MC2_ERASE_SIZE];
523 std::memset(buf, 0xff, sizeof(buf));
524 return std::fwrite(buf, sizeof(buf), 1, mcfp) == 1;
525}
526
527u64 FileMemoryCard::GetCRC(uint slot)
528{

Callers 1

FileMcd_EraseBlockFunction · 0.45

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected