mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Replay: Skip recording virtual disc reads.
Oops.
This commit is contained in:
1 parent
03c2292ae9
commit
224229fc1b
3 files changed
+16
-18
No files matched your search
@@ -324,7 +324,7 @@ size_t DirectoryFileHandle::Read(u8* pointer, s64 size)
|
||||
// On a PSP. it actually is truncated, but the data wasn't erased.
|
||||
off_t off = (off_t)Seek(0, FILEMOVE_CURRENT);
|
||||
if (needsTrunc_ <= off) {
|
||||
return ReplayApplyDiskRead(pointer, 0, (uint32_t)size, CoreTiming::GetGlobalTimeUs());
|
||||
return replay_ ? ReplayApplyDiskRead(pointer, 0, (uint32_t)size, CoreTiming::GetGlobalTimeUs()) : 0;
|
||||
}
|
||||
if (needsTrunc_ < off + size) {
|
||||
size = needsTrunc_ - off;
|
||||
@@ -335,7 +335,7 @@ size_t DirectoryFileHandle::Read(u8* pointer, s64 size)
|
||||
#else
|
||||
bytesRead = read(hFile, pointer, size);
|
||||
#endif
|
||||
return ReplayApplyDiskRead(pointer, (uint32_t)bytesRead, (uint32_t)size, CoreTiming::GetGlobalTimeUs());
|
||||
return replay_ ? ReplayApplyDiskRead(pointer, (uint32_t)bytesRead, (uint32_t)size, CoreTiming::GetGlobalTimeUs()) : bytesRead;
|
||||
}
|
||||
|
||||
size_t DirectoryFileHandle::Write(const u8* pointer, s64 size)
|
||||
@@ -412,7 +412,7 @@ size_t DirectoryFileHandle::Seek(s32 position, FileMove type)
|
||||
result = lseek(hFile, position, moveMethod);
|
||||
#endif
|
||||
|
||||
return (size_t)ReplayApplyDisk64(ReplayAction::FILE_SEEK, result, CoreTiming::GetGlobalTimeUs());
|
||||
return replay_ ? (size_t)ReplayApplyDisk64(ReplayAction::FILE_SEEK, result, CoreTiming::GetGlobalTimeUs()) : result;
|
||||
}
|
||||
|
||||
void DirectoryFileHandle::Close()
|
||||
|
||||
@@ -57,23 +57,21 @@ enum FixPathCaseBehavior {
|
||||
bool FixPathCase(std::string& basePath, std::string &path, FixPathCaseBehavior behavior);
|
||||
#endif
|
||||
|
||||
struct DirectoryFileHandle
|
||||
{
|
||||
#ifdef _WIN32
|
||||
HANDLE hFile;
|
||||
#else
|
||||
int hFile;
|
||||
#endif
|
||||
s64 needsTrunc_;
|
||||
struct DirectoryFileHandle {
|
||||
enum Flags {
|
||||
NORMAL,
|
||||
SKIP_REPLAY,
|
||||
};
|
||||
|
||||
DirectoryFileHandle()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
hFile = (HANDLE)-1;
|
||||
HANDLE hFile = (HANDLE)-1;
|
||||
#else
|
||||
hFile = -1;
|
||||
int hFile = -1;
|
||||
#endif
|
||||
needsTrunc_ = -1;
|
||||
s64 needsTrunc_ = -1;
|
||||
bool replay_ = true;
|
||||
|
||||
DirectoryFileHandle(Flags flags) : replay_(flags != SKIP_REPLAY) {
|
||||
}
|
||||
|
||||
std::string GetLocalPath(std::string& basePath, std::string localpath);
|
||||
@@ -115,7 +113,7 @@ public:
|
||||
|
||||
private:
|
||||
struct OpenFileEntry {
|
||||
DirectoryFileHandle hFile;
|
||||
DirectoryFileHandle hFile = DirectoryFileHandle::NORMAL;
|
||||
std::string guestFilename;
|
||||
FileAccess access;
|
||||
};
|
||||
|
||||
@@ -127,7 +127,7 @@ private:
|
||||
typedef enum { VFILETYPE_NORMAL, VFILETYPE_LBN, VFILETYPE_ISO } VirtualFileType;
|
||||
|
||||
struct OpenFileEntry {
|
||||
DirectoryFileHandle hFile;
|
||||
DirectoryFileHandle hFile = DirectoryFileHandle::SKIP_REPLAY;
|
||||
HandlerFileHandle handler;
|
||||
VirtualFileType type;
|
||||
u32 fileIndex;
|
||||
|
||||
Reference in new issue
Block a user