Display delayed threads in IOP thread view.

This commit is contained in:
Jean-Philip Desjardins 2018-07-11 21:06:16 -04:00
parent 6fb78889a7
commit bbc27c677e
2 changed files with 13 additions and 3 deletions

View File

@ -11,6 +11,7 @@
#include <vector>
#include "xml/FilteringNodeIterator.h"
#include "../StructCollectionStateFile.h"
#include "string_format.h"
#ifdef _IOP_EMULATE_MODULES
#include "Iop_Cdvdfsv.h"
@ -1575,7 +1576,7 @@ uint32 CIopBios::GetNextReadyThread()
return -1;
}
uint64 CIopBios::GetCurrentTime()
uint64 CIopBios::GetCurrentTime() const
{
return CurrentTime();
}
@ -3133,13 +3134,22 @@ BiosDebugThreadInfoArray CIopBios::GetThreadsDebugInfo() const
threadInfo.sp = thread->context.gpr[CMIPS::SP];
}
int64 deltaTime = thread->nextActivateTime - GetCurrentTime();
switch(thread->status)
{
case THREAD_STATUS_DORMANT:
threadInfo.stateDescription = "Dormant";
break;
case THREAD_STATUS_RUNNING:
threadInfo.stateDescription = "Running";
if(deltaTime <= 0)
{
threadInfo.stateDescription = "Running";
}
else
{
threadInfo.stateDescription = string_format("Delayed (%ld ticks)", deltaTime);
}
break;
case THREAD_STATUS_SLEEPING:
threadInfo.stateDescription = "Sleeping";

View File

@ -147,7 +147,7 @@ public:
void Reschedule();
void CountTicks(uint32) override;
uint64 GetCurrentTime();
uint64 GetCurrentTime() const;
uint64 MilliSecToClock(uint32);
uint64 MicroSecToClock(uint32);
uint64 ClockToMicroSec(uint64);