From e6375fe84d678a74393b70cc720a11cfbdf89c96 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 3 Mar 2013 16:05:05 -0800 Subject: [PATCH] Fix initialization problems in sceIo. These were making savestates unstable. --- Core/HLE/sceIo.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index 38afc9c2f8..9ea49f0056 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -133,7 +133,7 @@ struct dirent { class FileNode : public KernelObject { public: - FileNode() : callbackID(0), callbackArg(0), asyncResult(0), closePending(false), pendingAsyncResult(false), sectorBlockMode(false) {} + FileNode() : callbackID(0), callbackArg(0), asyncResult(0), pendingAsyncResult(false), sectorBlockMode(false), closePending(false), npdrm(0), pgdInfo(NULL) {} ~FileNode() { pspFileSystem.CloseFile(handle); } @@ -156,6 +156,9 @@ public: p.Do(closePending); p.Do(info); p.Do(openMode); + + // TODO: Savestate PGD files? + p.DoMarker("File"); } @@ -603,8 +606,6 @@ u32 sceIoOpen(const char* filename, int flags, int mode) { access |= FILEACCESS_APPEND; if (flags & O_CREAT) access |= FILEACCESS_CREATE; - if (flags & O_NPDRM) - PSPFileInfo info = pspFileSystem.GetFileInfo(filename); u32 h = pspFileSystem.OpenFile(filename, (FileAccess) access); @@ -620,7 +621,7 @@ u32 sceIoOpen(const char* filename, int flags, int mode) { f->handle = h; f->fullpath = filename; f->asyncResult = id; - f->info = pspFileSystem.GetFileInfo(filename); + f->info = info; f->openMode = access; f->npdrm = (flags & O_NPDRM)? true: false;