From 05711986190c1656c5b503fe67db53a768fa130b Mon Sep 17 00:00:00 2001 From: gigaherz Date: Sat, 10 Nov 2012 12:15:44 +0100 Subject: [PATCH 1/4] Actually parse the "." and ".." entries of the filesystem, but ignore them on the list since games don't expect to see them there. --- Core/FileSystems/ISOFileSystem.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Core/FileSystems/ISOFileSystem.cpp b/Core/FileSystems/ISOFileSystem.cpp index d779a3035e..32bbdef5a2 100644 --- a/Core/FileSystems/ISOFileSystem.cpp +++ b/Core/FileSystems/ISOFileSystem.cpp @@ -187,10 +187,18 @@ nextblock: name[i] = buffer[33+i] ? buffer[33+i] : '.'; name[fnLength] = '\0'; + bool relative = false; + if (!strcmp(name, ".")) // "." record - continue; + { + relative = true; + } + if (strlen(name) == 1 && name[0] == '\x01') // ".." record - continue; + { + strcpy(name,".."); + relative=true; + } TreeEntry *e = new TreeEntry; e->name = name; @@ -202,7 +210,7 @@ nextblock: DEBUG_LOG(FILESYS, "%s: %s %08x %08x %i", e->isDirectory?"D":"F", name, dir.firstDataSectorLE, e->startingPosition, e->startingPosition); - if (e->isDirectory) + if (e->isDirectory && !relative) { if (dir.firstDataSectorLE == startsector) { @@ -500,18 +508,13 @@ std::vector ISOFileSystem::GetDirListing(std::string path) return myVector; } - // fake the . and .. - PSPFileInfo x; - x.type = FILETYPE_DIRECTORY; - x.name = "."; - x.isOnSectorSystem = true; - myVector.push_back(x); - x.name = ".."; - myVector.push_back(x); - for (size_t i=0; ichildren.size(); i++) { TreeEntry *e = entry->children[i]; + + if(e->name[0] == '.') // do not include the relative entries in the list + continue; + PSPFileInfo x; x.name = e->name; x.access = FILEACCESS_READ; From d66f315902c6cc5770cc6001aa31f907fec971e1 Mon Sep 17 00:00:00 2001 From: gigaherz Date: Sat, 10 Nov 2012 12:16:23 +0100 Subject: [PATCH 2/4] Add a null check to the filename in sceKernelLoadModule. --- Core/HLE/sceKernelModule.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index 5b1017a392..b89200c17b 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -553,6 +553,9 @@ void sceKernelLoadExec() u32 sceKernelLoadModule(const char *name, u32 flags) { + if(!name) + return 0; + PSPFileInfo info = pspFileSystem.GetFileInfo(name); std::string error_string; s64 size = (s64)info.size; From b45209c8729b98cd8698816113d8a6d428c324c4 Mon Sep 17 00:00:00 2001 From: gigaherz Date: Sat, 10 Nov 2012 12:17:07 +0100 Subject: [PATCH 3/4] Normalize line endings in ppsspp.rc --- Windows/ppsspp.rc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Windows/ppsspp.rc b/Windows/ppsspp.rc index 48374c020b..e6fb9af450 100644 --- a/Windows/ppsspp.rc +++ b/Windows/ppsspp.rc @@ -7,7 +7,8 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#include "afxres.h" +#include "afxres.h" + ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -414,7 +415,8 @@ END // // Generated from the TEXTINCLUDE 3 resource. // - + + ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED From 106395f392f89448a867056db0ee42f18c1dcb2d Mon Sep 17 00:00:00 2001 From: gigaherz Date: Sat, 10 Nov 2012 12:32:23 +0100 Subject: [PATCH 4/4] Make sure it REALLY is a relative entry. --- Core/FileSystems/ISOFileSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/FileSystems/ISOFileSystem.cpp b/Core/FileSystems/ISOFileSystem.cpp index 32bbdef5a2..2082472475 100644 --- a/Core/FileSystems/ISOFileSystem.cpp +++ b/Core/FileSystems/ISOFileSystem.cpp @@ -512,7 +512,7 @@ std::vector ISOFileSystem::GetDirListing(std::string path) { TreeEntry *e = entry->children[i]; - if(e->name[0] == '.') // do not include the relative entries in the list + if(!strcmp(e->name, ".") || !strcmp(e->name, "..")) // do not include the relative entries in the list continue; PSPFileInfo x;