mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Clean up sceKernelReferFplStatus().
This commit is contained in:
parent
fb95f07c5d
commit
a947c95829
3 changed files with 11 additions and 11 deletions
|
@ -802,7 +802,7 @@ const HLEFunction ThreadManForUser[] =
|
|||
{0x623AE665,sceKernelTryAllocateFpl,"sceKernelTryAllocateFpl"},
|
||||
{0xF6414A71,sceKernelFreeFpl,"sceKernelFreeFpl"},
|
||||
{0xA8AA591F,WrapI_IU<sceKernelCancelFpl>, "sceKernelCancelFpl"},
|
||||
{0xD8199E4C,sceKernelReferFplStatus,"sceKernelReferFplStatus"},
|
||||
{0xD8199E4C,WrapI_IU<sceKernelReferFplStatus>, "sceKernelReferFplStatus"},
|
||||
|
||||
{0x20fff560,WrapU_CU<sceKernelCreateVTimer>,"sceKernelCreateVTimer"},
|
||||
{0x328F9E52,WrapU_U<sceKernelDeleteVTimer>,"sceKernelDeleteVTimer"},
|
||||
|
|
|
@ -594,16 +594,14 @@ int sceKernelCancelFpl(SceUID uid, u32 numWaitThreadsPtr)
|
|||
}
|
||||
}
|
||||
|
||||
void sceKernelReferFplStatus()
|
||||
int sceKernelReferFplStatus(SceUID uid, u32 statusPtr)
|
||||
{
|
||||
SceUID id = PARAM(0);
|
||||
u32 statusAddr = PARAM(1);
|
||||
DEBUG_LOG(HLE,"sceKernelReferFplStatus(%i, %08x)", id, statusAddr);
|
||||
u32 error;
|
||||
FPL *fpl = kernelObjects.Get<FPL>(id, error);
|
||||
FPL *fpl = kernelObjects.Get<FPL>(uid, error);
|
||||
if (fpl)
|
||||
{
|
||||
// Refresh free block count.
|
||||
DEBUG_LOG(HLE, "sceKernelReferFplStatus(%i, %08x)", uid, statusPtr);
|
||||
// Refresh waiting threads and free block count.
|
||||
fpl->nf.numWaitThreads = (int) fpl->waitingThreads.size();
|
||||
fpl->nf.numFreeBlocks = 0;
|
||||
for (int i = 0; i < (int)fpl->nf.numBlocks; ++i)
|
||||
|
@ -611,12 +609,14 @@ void sceKernelReferFplStatus()
|
|||
if (!fpl->blocks[i])
|
||||
++fpl->nf.numFreeBlocks;
|
||||
}
|
||||
Memory::WriteStruct(statusAddr, &fpl->nf);
|
||||
RETURN(0);
|
||||
if (Memory::Read_U32(statusPtr) != 0)
|
||||
Memory::WriteStruct(statusPtr, &fpl->nf);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
RETURN(error);
|
||||
DEBUG_LOG(HLE, "sceKernelReferFplStatus(%i, %08x): invalid fpl", uid, statusPtr);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ void sceKernelAllocateFplCB();
|
|||
void sceKernelTryAllocateFpl();
|
||||
void sceKernelFreeFpl();
|
||||
int sceKernelCancelFpl(SceUID uid, u32 numWaitThreadsPtr);
|
||||
void sceKernelReferFplStatus();
|
||||
int sceKernelReferFplStatus(SceUID uid, u32 statusPtr);
|
||||
|
||||
int sceKernelGetCompiledSdkVersion();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue