clears all save memory. call this if you want to pretend the saveram has been reset (it doesnt touch what is on disk though)
| 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) |
| 592 | void 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 | } |