mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-05 13:54:22 +01:00
sceNetAdhocMatching: Start returns 0, not the matching thread's ID
The fake matching thread was started through sceKernelStartThread, which switched threads inside the call, and the game got the new thread's ID back. On a PSP, Start returns 0 (pspautotests net/adhoc/matching). Create and start it like adhocctl's thread instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ae906cb292
commit
ce81c07a69
1 file changed
+5
-2
@@ -1925,10 +1925,13 @@ int NetAdhocMatching_Start(int matchingId, int evthPri, int evthPartitionId, int
|
||||
// Create & Start the Fake PSP Thread ("matching_ev%d" and "matching_io%d")
|
||||
netAdhocMatchingValidateLoopMemory();
|
||||
std::string thrname = std::string("MatchingThr") + std::to_string(matchingId);
|
||||
matchingThreads[item->matching_thid] = hleCall(ThreadManForUser, int, sceKernelCreateThread, thrname.c_str(), matchingThreadHackAddr, evthPri, evthStack, 0, 0);
|
||||
// Created and started without rescheduling, like adhocctl's thread: starting it through
|
||||
// sceKernelStartThread switched threads inside this call, and the game got the thread's ID back
|
||||
// instead of 0 (pspautotests net/adhoc/matching).
|
||||
matchingThreads[item->matching_thid] = __KernelCreateThread(thrname.c_str(), __KernelGetCurThreadModuleId(), matchingThreadHackAddr, evthPri, evthStack, PSP_THREAD_ATTR_USER, 0, true);
|
||||
//item->matchingThread = new HLEHelperThread(thrname.c_str(), "sceNetAdhocMatching", "__NetMatchingCallbacks", inthPri, inthStack);
|
||||
if (matchingThreads[item->matching_thid] > 0) {
|
||||
hleCall(ThreadManForUser, int, sceKernelStartThread, matchingThreads[item->matching_thid], 0, 0); //sceKernelStartThread(context->event_thid, sizeof(context), &context);
|
||||
__KernelStartThread(matchingThreads[item->matching_thid], 0, 0);
|
||||
//item->matchingThread->Start(matchingId, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user