mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-17 00:10:31 +02:00
sceKernelLoadModule: Resolve a relative path when the load is requested
- Fixes #22578 Since loads became deferred (#22507), the file is read from the event at the end of the wait, where there is no current thread and so no current directory. Crash Tag Team Racing loads its PRXs as "prx/sc_sascore.prx" and so on, got NOCWD for all of them and never started. Make the path absolute with the caller's current directory before waiting. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
edc6620348
commit
8087ad652b
1 file changed
+9
@@ -2733,6 +2733,15 @@ u32 sceKernelLoadModule(const char *name, u32 flags, u32 optionAddr) {
|
||||
const SceUID threadID = __KernelGetCurThread();
|
||||
PendingModuleLoad &load = g_pendingModuleLoads[threadID];
|
||||
load.name = name;
|
||||
// The event loads outside of any thread, so a relative path (Crash Tag Team Racing loads
|
||||
// "prx/sc_sascore.prx") has to be resolved against the caller's current directory now.
|
||||
// modulemgr.prx's sceKernelLoadModule also opens the file in the caller's thread.
|
||||
if (load.name.find(':') == std::string::npos) {
|
||||
const std::string cwd = pspFileSystem.GetCurrentDirForThread(threadID);
|
||||
if (!cwd.empty()) {
|
||||
load.name = cwd + "/" + load.name;
|
||||
}
|
||||
}
|
||||
load.flags = flags;
|
||||
load.hasOption = lmoption != nullptr;
|
||||
if (lmoption) {
|
||||
|
||||
Reference in new issue
Block a user