Replay: Attempt to ignore reads in PSP/GAME.

Unless there are writes in this directory, we should be able to safely
ignore them.

Currently detection isn't perfect (like PSP/./GAME/../GAME), but this
should catch the vast majority of cases.
This commit is contained in:
Unknown W. Brackets
2019-07-04 23:46:15 -07:00
parent 4144e71b7a
commit 33cfac549d
4 changed files with 53 additions and 18 deletions
+4 -3
View File
@@ -54,7 +54,7 @@ enum FixPathCaseBehavior {
FPC_PARTIAL_ALLOWED, // don't care how many exist (mkdir recursive)
};
bool FixPathCase(std::string& basePath, std::string &path, FixPathCaseBehavior behavior);
bool FixPathCase(const std::string &basePath, std::string &path, FixPathCaseBehavior behavior);
#endif
struct DirectoryFileHandle {
@@ -70,12 +70,13 @@ struct DirectoryFileHandle {
#endif
s64 needsTrunc_ = -1;
bool replay_ = true;
bool inGameDir_ = false;
DirectoryFileHandle(Flags flags) : replay_(flags != SKIP_REPLAY) {
}
std::string GetLocalPath(std::string& basePath, std::string localpath);
bool Open(std::string& basePath, std::string& fileName, FileAccess access, u32 &err);
std::string GetLocalPath(const std::string &basePath, std::string localpath);
bool Open(const std::string &basePath, std::string &fileName, FileAccess access, u32 &err);
size_t Read(u8* pointer, s64 size);
size_t Write(const u8* pointer, s64 size);
size_t Seek(s32 position, FileMove type);