Memory Cards: Use file memory mapping instead of explicit file I/O #12187
+111
−40
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.
(This is a rough draft, Windows only for now until a more elegant interface is created)
Description of Changes
Instead of freads for every memory card read, map the entire memory card into a memory mapping and let the OS manage caching / paging (hopefully) a little more efficient.
Rationale behind Changes
This completely eliminated a bottleneck I found on the Persona 3 memory card menu. Overall memory card reads and block clearing should be faster with less EE thread usage.
Suggested Testing Steps
This is experimental and with all memory card code changes, scary! Please do not try this on memory cards you don't want to possibly lose. Writes to the memory card excluding clears still use file IO, so in theory it should be safe from causing corruption.
To test you just have see if memory card stuff works. Saving / formatting / reading.