Fix Pangya: Fantasy Golf hang when going in-game via emulating SCE_KERNEL_ERROR_NOCWD correctly, or at least, more correctly than it was before.

This commit is contained in:
The Dax
2013-05-30 16:15:15 -04:00
parent 5c22ef363c
commit 370b50a328
2 changed files with 19 additions and 7 deletions

View File

@@ -171,6 +171,7 @@ IFileSystem *MetaFileSystem::GetHandleOwner(u32 handle)
return 0;
}
extern u32 errorCode;
bool MetaFileSystem::MapFilePath(const std::string &_inpath, std::string &outpath, MountPoint **system)
{
std::string realpath;
@@ -187,11 +188,12 @@ bool MetaFileSystem::MapFilePath(const std::string &_inpath, std::string &outpat
int currentThread = __KernelGetCurThread();
currentDir_t::iterator it = currentDir.find(currentThread);
if (it == currentDir.end())
//Attempt to emulate SCE_KERNEL_ERROR_NOCWD / 8002032C: may break things requiring fixes elsewhere
if (inpath.find(':') == std::string::npos /* means path is relative */)
{
//TODO: emulate PSP's error 8002032C: "no current working directory" if relative... may break things requiring fixes elsewhere
if (inpath.find(':') == std::string::npos /* means path is relative */)
WARN_LOG_REPORT(HLE, "Path is relative, but current directory not set for thread %i. Should give error, instead falling back to %s", currentThread, startingDirectory.c_str());
errorCode = SCE_KERNEL_ERROR_NOCWD;
WARN_LOG_REPORT(HLE, "Path is relative, but current directory not set for thread %i. returning 8002032C(SCE_KERNEL_ERROR_NOCWD) instead.", currentThread, startingDirectory.c_str());
return false;
}
else
{