MCPcopy Create free account
hub / github.com/TASEmulators/fceux / FCEU_ClearGameSave

Function FCEU_ClearGameSave

src/cart.cpp:592–608  ·  view source on GitHub ↗

clears all save memory. call this if you want to pretend the saveram has been reset (it doesnt touch what is on disk though)

Source from the content-addressed store, hash-verified

590
591//clears all save memory. call this if you want to pretend the saveram has been reset (it doesnt touch what is on disk though)
592void FCEU_ClearGameSave(CartInfo *LocalHWInfo)
593{
594 if (LocalHWInfo->battery && !LocalHWInfo->SaveGame.empty())
595 {
596 for (size_t x = 0; x < LocalHWInfo->SaveGame.size(); x++)
597 {
598 if (LocalHWInfo->SaveGame[x].bufptr)
599 {
600 memset(LocalHWInfo->SaveGame[x].bufptr, 0, LocalHWInfo->SaveGame[x].buflen);
601 }
602 if (LocalHWInfo->SaveGame[x].resetFunc)
603 {
604 LocalHWInfo->SaveGame[x].resetFunc();
605 }
606 }
607 }
608}

Callers 2

UNIFGIFunction · 0.85
iNESGIFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected