Fix initialization problems in sceIo.

These were making savestates unstable.
This commit is contained in:
Unknown W. Brackets 2013-03-03 16:05:05 -08:00
parent 2d5f647579
commit e6375fe84d

View File

@ -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;