mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix crash in sceKernelReferSemaStatus.
This was crashing threads/semaphores, and also PQ2 (and maybe other games.) Note: threads/semaphores still not passing.
This commit is contained in:
parent
59d623a0f2
commit
3acca0f941
1 changed files with 2 additions and 2 deletions
|
@ -72,6 +72,7 @@ void sceKernelCreateSema()
|
|||
Semaphore *s = new Semaphore;
|
||||
SceUID id = kernelObjects.Create(s);
|
||||
|
||||
s->ns.size = sizeof(NativeSemaphore);
|
||||
strncpy(s->ns.name, name, 32);
|
||||
s->ns.attr = PARAM(1);
|
||||
s->ns.initCount = PARAM(2);
|
||||
|
@ -101,8 +102,7 @@ void sceKernelReferSemaStatus()
|
|||
{
|
||||
DEBUG_LOG(HLE,"sceKernelReferSemaStatus(%i, %08x)", id, PARAM(1));
|
||||
NativeSemaphore *outptr = (NativeSemaphore*)Memory::GetPointer(PARAM(1));
|
||||
int szToCopy = outptr->size - 4;
|
||||
memcpy((char*)outptr + 4, (char*)s + 4, szToCopy);
|
||||
memcpy((char*)outptr, (char*)&s->ns, s->ns.size);
|
||||
RETURN(0);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue