diff --git a/Source/iop/IopBios.cpp b/Source/iop/IopBios.cpp index 6ead50b0..b21de627 100644 --- a/Source/iop/IopBios.cpp +++ b/Source/iop/IopBios.cpp @@ -11,6 +11,7 @@ #include #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"; diff --git a/Source/iop/IopBios.h b/Source/iop/IopBios.h index 6c6dccdb..30e0473f 100644 --- a/Source/iop/IopBios.h +++ b/Source/iop/IopBios.h @@ -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);