mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Properly delete alarms after they run.
Also fix refer, based on tests.
This commit is contained in:
parent
522b16bb89
commit
dbec955a99
1 changed files with 13 additions and 7 deletions
|
@ -64,8 +64,15 @@ public:
|
|||
// A non-zero result means to reschedule.
|
||||
if (result > 0)
|
||||
__KernelScheduleAlarm(alarm, (u64) usToCycles(result));
|
||||
else if (result < 0)
|
||||
WARN_LOG(HLE, "Alarm requested reschedule for negative value %u, ignoring", (unsigned) result);
|
||||
else
|
||||
{
|
||||
if (result < 0)
|
||||
WARN_LOG(HLE, "Alarm requested reschedule for negative value %u, ignoring", (unsigned) result);
|
||||
|
||||
// Delete the alarm if it's not rescheduled.
|
||||
__ReleaseSubInterruptHandler(PSP_SYSTIMER0_INTR, alarm->GetUID());
|
||||
kernelObjects.Destroy<Alarm>(alarm->GetUID());
|
||||
}
|
||||
}
|
||||
|
||||
Alarm *alarm;
|
||||
|
@ -167,14 +174,13 @@ int sceKernelReferAlarmStatus(SceUID uid, u32 infoPtr)
|
|||
u32 size = Memory::Read_U32(infoPtr);
|
||||
|
||||
// Alarms actually respect size and write (kinda) what it can hold.
|
||||
// Intentionally 1 not 4.
|
||||
if (size >= 1)
|
||||
if (size > 0)
|
||||
Memory::Write_U32(alarm->alm.size, infoPtr);
|
||||
if (size >= 12)
|
||||
if (size > 4)
|
||||
Memory::Write_U64(alarm->alm.schedule, infoPtr + 4);
|
||||
if (size >= 16)
|
||||
if (size > 12)
|
||||
Memory::Write_U32(alarm->alm.handlerPtr, infoPtr + 12);
|
||||
if (size >= 20)
|
||||
if (size > 16)
|
||||
Memory::Write_U32(alarm->alm.commonPtr, infoPtr + 16);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue