memcard: Detect and attempt to repair broken index files from the v1.7.2115 bug #5751
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
The current folder memory card implementation appears to still be working as intended after the aforementioned fix #5356 but some people have been obviously caught by it. The folder memory card code is currently being re-written, so it doesn't make sense to go too crazy with re-writing.
If the index file is detected as malformed, it backs it up and re-creates it by scanning the directory. For most games, (i've tested with a few), this brings things back to a working state with no data loss.
Rationale behind Changes
Only the index file is broken because of the aforementioned bug, which only matters for very specific games that depend on the order of the files (ie. GTA).
Suggested Testing Steps
_pcsx2_index
file, you should see an error in the console when booting games and it should patch things up -- see if you can load your save files as expected